Error 1: How to view logs when a program is running in error
First open windows, then open the show View, find Logcat, click the mouse, open the log to try, based on the log information to find errors.
Error 2:Sqlitedatabase created and never closed error
if it is used Openorcreatedatabase's method , you can resolve the database by manually releasing it, plus db.close () . This group recommends that you use The Help class Sqliteopenhelper provided by Android to create a database better
Error 3:how theandroid app exits safely
by creating an exception to cause FC, in order not to eject the Force Close dialog box, you can override the Android of the Application class, implement it yourself Thread,uncaughtexceptionhandler interface of uncautexecption method, which is basically safe to exit, but can also be broadcast in the form of each Activity are closed.
Error 4: when you switch across the screen, Activity will the life cycle change?
( 1 ) does not set Activity of the android:configchanges , the toggle screen will recall the life cycle, which will be performed once when the screen is toggled, and will be executed two times when the screen is toggled.
( 2 ) Settings Activity of the android:configchanges= "Orientation" , the switch screen will recall the life cycle, and it will only be executed once when the horizontal and vertical screens are toggled.
( 3 ) Settings Activity of the android:configchanges= "orientation | keyboardhidden" , the toggle screen does not recall the life cycle and only executes onconfigurationchanged method.
Error 5: InAndroid If the interface is not responding for 5 seconds will pop up the dialog box, how to avoid it?
The main thing to avoid is to execute the time-consuming operation in a child thread, and U interface separation.
Error 6: I accidentally modified it. Classpath file, the program cannot run, what should I do?
You can now open a correct project with Notepad Classpath file, copy the content, and then duplicate it.
ERROR 7: XML file does not display properties ( No Grammar constraints (DTD or XML Schema) detected for the Documen ) The error
Start by noticing that you cannot use spaces to turn off reboots.
Error 8: How to judge the screen
Complete with the following code
if (This.getresources (). GetConfiguration (). Orientation = = configuration.orientation_portrait) {//< Span style= "font-family: the song Body;" > vertical screen
//dosomething
}else{
//dosomething
}
Error 9: android.content.activitynotefoudexception: Unable to find explicit activity class{xxxxx} error
activity no registration
error Ten: exception: unable to load view in XML;
See if there is a Statement
error One by one: use project has no target set. Edit the project properties to set one. error
in the properties of the item, select The Android version of Project build Target . If you are prompted about errors in Androidmanifest.xml, Select this item and right-click to select
Android tools--fix Project items will be repaired automatically.
Jack Bauer sweeps the big sweep