我已经制作了一个可以很好地在 android 手机和模拟器上运行的应用程序,但是当我在 Nexus 7 上运行它时它给了我一个错误:
这是我的 logcat 报告:
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.aks.mobilereagents/com.aks.mobilereagents.MobileReagentsAc
tivity}: java.lang.NullPointerException at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method) at
java.lang.reflect.Method.invoke(Method.java:507)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:8
67)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method) Caused by:
java.lang.NullPointerException at
com.aks.mobilereagents.MobileReagentsActivity.onCreate(MobileReagentsActivit
y.java:153)
at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
... 11 more