tsun1217
tsun1217
2017-08-09 01:26

编写了一个百度地图定位的Android程序,结果一点击就直接退出来,各位帮我看看,错误日志如下

5
  • exception
  • 百度
  • android

08-09 09:19:59.057 25412-25412/? I/art: Late-enabling -Xcheck:jni
08-09 09:19:59.057 25412-25412/? I/art: Reinit property: dalvik.vm.checkjni= false
08-09 09:19:59.190 25412-25412/com.example.tsun.campusnav I/InstantRun: starting instant run server: is main process
08-09 09:19:59.210 25412-25412/com.example.tsun.campusnav I/HwCust: Constructor found for class android.app.HwCustActivityImpl
08-09 09:19:59.228 25412-25412/com.example.tsun.campusnav E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.tsun.campusnav, PID: 25412
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.tsun.campusnav/com.example.tsun.campusnav.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.Window$Callback android.view.Window.getCallback()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2692)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2864)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1567)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6531)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.Window$Callback android.view.Window.getCallback()' on a null object reference
at android.support.v7.app.AppCompatDelegateImplBase.(AppCompatDelegateImplBase.java:118)
at android.support.v7.app.AppCompatDelegateImplV9.(AppCompatDelegateImplV9.java:152)
at android.support.v7.app.AppCompatDelegateImplV11.(AppCompatDelegateImplV11.java:29)
at android.support.v7.app.AppCompatDelegateImplV14.(AppCompatDelegateImplV14.java:53)
at android.support.v7.app.AppCompatDelegateImplV23.(AppCompatDelegateImplV23.java:31)
at android.support.v7.app.AppCompatDelegateImplN.(AppCompatDelegateImplN.java:31)
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:200)
at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:184)
at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:518)
at android.support.v7.app.AppCompatActivity.findViewById(AppCompatActivity.java:189)
at com.example.tsun.campusnav.MainActivity.(MainActivity.java:41)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1083)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2682)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2864) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1567) 
at android.os.Handler.dispatchMessage(Handler.java:105) 
at android.os.Looper.loop(Looper.java:156) 
at android.app.ActivityThread.main(ActivityThread.java:6531) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831) 
08-09 09:19:59.235 25412-25412/com.example.tsun.campusnav I/Process: Sending signal. PID: 25412 SIG: 9

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

7条回答