TabHost在android2.1上出现空指针异常,提示:android.widget.TabHost.dispatchWindowFocusChanged

报错信息:

10-19 12:16:34.335: ERROR/AndroidRuntime(256): Uncaught handler: thread main exiting due to uncaught exception
10-19 12:16:34.378: ERROR/AndroidRuntime(256): java.lang.NullPointerException
10-19 12:16:34.378: ERROR/AndroidRuntime(256):     at android.widget.TabHost.dispatchWindowFocusChanged(TabHost.java:295)
10-19 12:16:34.378: ERROR/AndroidRuntime(256):     at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:661)
10-19 12:16:34.378: ERROR/AndroidRuntime(256):     at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:661)
10-19 12:16:34.378: ERROR/AndroidRuntime(256):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1819)
10-19 12:16:34.378: ERROR/AndroidRuntime(256):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-19 12:16:34.378: ERROR/AndroidRuntime(256):     at android.os.Looper.loop(Looper.java:123)
10-19 12:16:34.378: ERROR/AndroidRuntime(256):     at android.app.ActivityThread.main(ActivityThread.java:4363)
10-19 12:16:34.378: ERROR/AndroidRuntime(256):     at java.lang.reflect.Method.invokeNative(Native Method)
10-19 12:16:34.378: ERROR/AndroidRuntime(256):     at java.lang.reflect.Method.invoke(Method.java:521)
10-19 12:16:34.378: ERROR/AndroidRuntime(256):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
10-19 12:16:34.378: ERROR/AndroidRuntime(256):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
10-19 12:16:34.378: ERROR/AndroidRuntime(256):     at dalvik.system.NativeStart.main(Native Method)

同一个应用在android2.2以上一起可以正常运行,但是到了android2.1就无法运行,报错空指针异常.关于tabhost的.

 

 


 

你可能感兴趣的:(thread,android,exception)