I'm hoping somebody who is more familiar with Android's application
life-cycle will be able to help me out here.

I'm writing a game.  From inside the game, I open a new activity (a
web browser window).  Once the user backs out of the browser window,
my game shows an error message and quits.  I imagine that this has
something to do with saving and restoring states, but the only errors
I receive are very vague, and they make it difficult to pinpoint the
problem.

For what it's worth, here is a stack trace from inside the Debugger:
Thread [<3> main] (Suspended (exception IllegalThreadStateException))
        StealthView(SurfaceView).updateWindow(boolean) line: 362
        StealthView(SurfaceView).onWindowVisibilityChanged(int) line: 173
        StealthView(View).dispatchWindowVisibilityChanged(int) line: 3215
        FrameLayout(ViewGroup).dispatchWindowVisibilityChanged(int) line:
675
        FrameLayout(ViewGroup).dispatchWindowVisibilityChanged(int) line:
675
        PhoneWindow$DecorView(ViewGroup).dispatchWindowVisibilityChanged(int)
line: 675
        ViewRoot.performTraversals() line: 587
        ViewRoot.handleMessage(Message) line: 1103
        ViewRoot(Handler).dispatchMessage(Message) line: 88
        Looper.loop() line: 123
        ActivityThread.main(String[]) line: 3742
        Method.invokeNative(Object, Object[], Class, Class[], Class, int,
boolean) line: not available [native method]
        Method.invoke(Object, Object...) line: 515
        ZygoteInit$MethodAndArgsCaller.run() line: 739
        ZygoteInit.main(String[]) line: 497
        NativeStart.main(String[]) line: not available [native method]




And here is a second listing of the error from /data/anr/traces.txt:

Cmd line: com.android.stealth

DALVIK THREADS:
"main" prio=5 tid=3 NATIVE
  | group="main" sCount=1 dsCount=0 s=0 obj=0x400143a8
  | sysTid=317 nice=0 sched=0/0 handle=-1096602468
  at android.os.BinderProxy.transact(Native Method)
  at android.app.ActivityManagerProxy.handleApplicationError
(ActivityManagerNative.java:2023)
  at com.android.internal.os.RuntimeInit.crash(RuntimeInit.java:302)
  at com.android.internal.os.RuntimeInit
$UncaughtHandler.uncaughtException(RuntimeInit.java:75)
  at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:853)
  at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:850)
  at dalvik.system.NativeStart.main(Native Method)

"Binder Thread #2" prio=5 tid=13 NATIVE
  | group="main" sCount=1 dsCount=0 s=0 obj=0x433f1270
  | sysTid=322 nice=0 sched=0/0 handle=1263336
  at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #1" prio=5 tid=11 NATIVE
  | group="main" sCount=1 dsCount=0 s=0 obj=0x433eceb8
  | sysTid=321 nice=0 sched=0/0 handle=818312
  at dalvik.system.NativeStart.run(Native Method)

"JDWP" daemon prio=5 tid=9 VMWAIT
  | group="system" sCount=1 dsCount=0 s=0 obj=0x433ec2a0
  | sysTid=320 nice=0 sched=0/0 handle=811056
  at dalvik.system.NativeStart.run(Native Method)

"Signal Catcher" daemon prio=5 tid=7 RUNNABLE
  | group="system" sCount=0 dsCount=0 s=0 obj=0x433ec1e8
  | sysTid=319 nice=0 sched=0/0 handle=810600
  at dalvik.system.NativeStart.run(Native Method)

"HeapWorker" daemon prio=5 tid=5 VMWAIT
  | group="system" sCount=1 dsCount=0 s=0 obj=0x4253fda0
  | sysTid=318 nice=0 sched=0/0 handle=810328
  at dalvik.system.NativeStart.run(Native Method)


According to the Java documentation I've been able to find,
IllegalThreadStateExceptions occur when a program attempts to start a
thread that is already running.  I really don't see how my program
could be doing that.

Up until now, I've been able to figure out any problems I have had by
comparing my code to the example LunarLander and Snake source codes.
This problem has stumped me though.  I've been going back over this
problem for several hours now, and as far as I can tell, my code for
saving and restoring states uses exactly the same technique as
LunarLander.  What could I be doing wrong?

Many thanks to anyone with a suggestion!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to