本文介绍了请告诉我这个例外?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个从主要活动叫做活动(书签)。的书签抛出异常(不是所有的时间)我想不出这是什么意思例外
I have an activity (BookMarks) that is called from main activity. BookMarks throw an exception (not all the time) I can't figure out what this exception means.
I/ActivityManager( 181): START {cmp=com.unreal.muslim/.BookMarks} from pid 25558
I/WindowManager( 181): createSurface Window{41fbf070 Loading... paused=false}: DRAW NOW PENDING
I/WindowManager( 181): createSurface Window{41da2230 com.unreal.muslim/com.unreal.muslim.BookMarks paused=false}: DRAW NOW PENDING
E/bm run catch(25558): Only the original thread that created a view hierarchy can touch its views.
D/AndroidRuntime(25558): Shutting down VM
W/dalvikvm(25558): threadid=1: thread exiting with uncaught exception (group=0x40a5d1f8)
E/AndroidRuntime(25558): FATAL EXCEPTION: main
E/AndroidRuntime(25558): java.lang.NullPointerException
E/AndroidRuntime(25558): at android.widget.AbsListView$RecycleBin.getScrapView(AbsListView.java:5900)
E/AndroidRuntime(25558): at android.widget.AbsListView.obtainView(AbsListView.java:2003)
E/AndroidRuntime(25558): at android.widget.ListView.measureHeightOfChildren(ListView.java:1244)
E/AndroidRuntime(25558): at android.widget.ListView.onMeasure(ListView.java:1155)
E/AndroidRuntime(25558): at android.view.View.measure(View.java:12603)
E/AndroidRuntime(25558): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4677)
E/AndroidRuntime(25558): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1369)
E/AndroidRuntime(25558): at android.widget.LinearLayout.measureVertical(LinearLayout.java:660)
E/AndroidRuntime(25558): at android.widget.LinearLayout.onMeasure(LinearLayout.java:553)
E/AndroidRuntime(25558): at android.view.View.measure(View.java:12603)
E/AndroidRuntime(25558): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4677)
E/AndroidRuntime(25558): at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
E/AndroidRuntime(25558): at android.view.View.measure(View.java:12603)
E/AndroidRuntime(25558): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4677)
E/AndroidRuntime(25558): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1369)
E/AndroidRuntime(25558): at android.widget.LinearLayout.measureVertical(LinearLayout.java:660)
E/AndroidRuntime(25558): at android.widget.LinearLayout.onMeasure(LinearLayout.java:553)
E/AndroidRuntime(25558): at android.view.View.measure(View.java:12603)
E/AndroidRuntime(25558): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4677)
E/AndroidRuntime(25558): at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
E/AndroidRuntime(25558): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2072)
E/AndroidRuntime(25558): at android.view.View.measure(View.java:12603)
E/AndroidRuntime(25558): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1044)
E/AndroidRuntime(25558): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2418)
E/AndroidRuntime(25558): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(25558): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(25558): at android.app.ActivityThread.main(ActivityThread.java:4340)
E/AndroidRuntime(25558): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(25558): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(25558): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
E/AndroidRuntime(25558): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
E/AndroidRuntime(25558): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 181): Force finishing activity com.unreal.muslim/.BookMarks
W/ActivityManager( 181): Force finishing activity com.unreal.muslim/.main
谁能帮我明白这一点例外,一个可能的解决方案来解决这个问题?
Can anyone help me understand this exception and a possible solution to fix it?
推荐答案
我觉得这是你的问题。
E/bm run catch(25558): Only the original thread that created a view hierarchy can touch its views.
你在哪里设置你的适配器为您的ListView?此外,你可以从你的活动发布code?
Where are you setting your Adapter for your ListView? Also, could you post code from your Activity?
这篇关于请告诉我这个例外?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!