Problem exiting an Activity using a SurfaceView
Have you ever met such problems? When exiting the activity in a thread in a SurfaceView
.
05-18 15:20:20.344: ERROR/AndroidRuntime(2018): Uncaught handler: thread main exiting due to uncaught exception
05-18 15:20:20.355: ERROR/AndroidRuntime(2018): java.lang.IllegalArgumentException: parameter must be a descendant of this view
05-18 15:20:20.355开发者_运维百科: ERROR/AndroidRuntime(2018): at android.view.ViewGroup.offsetRectBetweenParentAndChild(ViewGroup.java:2454)
05-18 15:20:20.355: ERROR/AndroidRuntime(2018): at android.view.ViewGroup.offsetDescendantRectToMyCoords(ViewGroup.java:2391)
05-18 15:20:20.355: ERROR/AndroidRuntime(2018): at android.view.ViewRoot.scrollToRectOrFocus(ViewRoot.java:1301)
05-18 15:20:20.355: ERROR/AndroidRuntime(2018): at android.view.ViewRoot.draw(ViewRoot.java:1107)
05-18 15:20:20.355: ERROR/AndroidRuntime(2018): at android.view.ViewRoot.performTraversals(ViewRoot.java:1030)
05-18 15:20:20.355: ERROR/AndroidRuntime(2018): at android.view.ViewRoot.handleMessage(ViewRoot.java:1482)
05-18 15:20:20.355: ERROR/AndroidRuntime(2018): at android.os.Handler.dispatchMessage(Handler.java:99)
05-18 15:20:20.355: ERROR/AndroidRuntime(2018): at android.os.Looper.loop(Looper.java:123)
05-18 15:20:20.355: ERROR/AndroidRuntime(2018): at android.app.ActivityThread.main(ActivityThread.java:3948)
05-18 15:20:20.355: ERROR/AndroidRuntime(2018): at java.lang.reflect.Method.invokeNative(Native Method)
05-18 15:20:20.355: ERROR/AndroidRuntime(2018): at java.lang.reflect.Method.invoke(Method.java:521)
05-18 15:20:20.355: ERROR/AndroidRuntime(2018): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
05-18 15:20:20.355: ERROR/AndroidRuntime(2018): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
05-18 15:20:20.355: ERROR/AndroidRuntime(2018): at dalvik.system.NativeStart.main(Native Method)
No. (that is the answer to your question :P)
To solve your problem, could you please post the code of the Activity this exception was thrown in? Especially parts where views are created&destroyed from code.
This seems like a platform issue that has not yet been resolved. I'm trying to find a way to trap the exception or avoid it somehow... I have the same problem in my app.
See also http://groups.google.com/group/android-developers/browse_thread/thread/4e2a2ac4d363d1f
精彩评论