Ext.: http://blog.csdn.net/huangxiaohu_coder/article/details/8497286
In the native Android to compile the APK, compile no problem, but at run time often appear as described in the title of the exception, and then the whole program crash off ...
I have encountered this problem often because of the modification of the resource files caused by, roughly the following several ways to solve:
1. Referencing a class name problem: Customizing a view to use in a layout file, assuming that his package is named MyPackage, the class name is Mytestview, and this time you are laying out XML as a layout element, you must use the full pathname, which is the package name plus the class name to refer to, Use Mypackage.mytestview to make references.
2. Constructor problem: To customize a view, you must derive the three constructors that implement the base class View
View (context context)//simple constructor to use where creating a view from code
View (context context, AttributeSet Attrs)//constructor that's called when inflating a view from XML
View (context context, AttributeSet attrs, int defstyle)//perform inflation from XML and apply a class-specific base s Tyle
From the introduction of the document, the second and third constructors have to be implemented for XML, and these three constructors should be used to instantiate a view object in different contexts.
3. Compiled intermediate files are not cleaned up: The third is you in the native system code compiled environment after the APK, especially modified XML, the title of the phenomenon described, this time you just need to delete the out directory compiled generated intermediate folder can be (the name is not clear: in the compilation process, The system will print that location, through the serial port to see it, .../out/....../..../classes.dex, you follow this path forward to your app's project name that layer folder), delete and re-make is OK.
4. Resource file not found: I originally in 2.3 of the native system to add live wallpaper, live wallpaper a run out of this anomaly, and then crash, then was because the drawable resource file was not found, so then I drawable hdpi or nodpi folder of the picture resources are copied a copy to DRAWB Le, problem solving (at the time it was not understood that the system will choose to load the resources under different drawable folders according to the resolution, why it must be put into drawable).
Android Runtime exception "Binary XML file Line #: Error inflating Class"