Started to develop Android apps because it was always Java development and learning was easier.
Keep track of some of the minor issues that arise during your own development:
in the development, because of habitual problems, often some commonly used data (such as user information, etc.) static save, and later tested, whether in the application or in the activity, as long as the initialization of the static variable activity is destroyed, The initialized variables are randomly destroyed according to the system's garbage collection mechanism (see http://blog.csdn.net/ctcwri/article/details/8858414for details). , so you should use some other methods to save the data, such as singleton mode.
- Findviewbyid NULL exception
When using multiple layout in an activity, the problem of Findviewbyid empty exceptions is also very error prone, since many times the view object is dynamically injected, so use View.findviewbyid when you use it.
- The method of data docking in general-purpose activity
In development, it is common to define some general activity to deal with the processing logic of each module, such as defining WebView and so on, do not need to define an activity every time, use common to deal with, and in the process of data transmission, The previous activity should use Intent.putextra to pass parameters and use bundle extras = Getintent () in general activity. Getextras (); To obtain, when acquired, Should be added to Judge Extras.containskey ("key") to proceed, at the beginning, I also habitually use extras.getstring ("key") ==null| | Extras.getstring ("key") = = "" Way to judge, the result is a heap of errors.
- customizing session issues in WebView
Custom WebView often in the Web page when the server side session loss problem, need to manually manage the WebView session to maintain synchronization with the server, otherwise, each access to the server, it is possible to create a new session.
Novice development Android Easy to appear error (constantly updated in ... )