Ext.: http://blog.csdn.net/gaohongijj/article/details/8010869/
There are three scenarios in which activity cannot be instantiated:
1. There is nomanifest.xmlList, register theActivity, or after the activity has been created, the package name or the class name of the activity is modified, and the configuration manifest is not modified, resulting in the inability to instantiate.
2. You create a new package, and the default package is still used when registering, for example, the default package isCom.ghg.DaoPackage, you've created a newCom.ghg.DaoImplPackage, and wrote in this package afirstactivityInmanifest.xmlWhen you register, you write<activity android:name= ". Firstactivity "/>, the equivalent of your class registered in the default package, the system is not found in the default package, because yourfirstactivityInCom.ghg.DaoImplPackage, so you should write the package name plus class name when registering, such as:<activity android:name= "com.ghg.DaoImpl.FirstActivity"/>So that the system can find the corresponding class in the specified package.
3. Still use one of yourfirstactivityis defined as an abstract class, which is not likely to be made by ordinary people.
If all three of the above are considered, and this exception is thrown, lookActivityDoes the class have both constructors andOnCreate ()If yes, then delete the constructor and put the initialization into
OnCreate ()Try it in.
Java.lang.RuntimeException:Unable to instantiate Activity ComponentInfo exception (RPM)