質問

When i run my error free app, it crashes on runtime. Null pointer Exception.

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.besu.test/com.besu.test.MainActivity}: java.lang.NullPointerException

Here is the deal, my package is: "com.besu.test" i dont know why eclipse duplicated it when the app launched the Main activity "com.besu.test.MainActivity" coz obviously no such directory as "com.besu.test/com.besu.test.MainActivity" is found in the project. and yes i did declare the activity in the manifest with the "category launcher" intent.

Appreciate it. cheers.

役に立ちましたか?

解決

ComponentInfo is a class that contains your app package and a fully qualified class name. No duplication there, it's just that your app package is the same as the package for your activity class.

In this case the ComponentInfo is used for identifying an activity to start, and there was an NPE starting the activity. The exception is wrapped in this RuntimeException with additional component information to help debugging.

To see the root NPE, look below in the stacktrace for a "caused by" exception and where it occurs in your code.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top