During the process that works for me during the e3roid scene population on android, I always encounter exceptions that I want to completely capture. Perhaps I need to create a reverse tracker to track exceptions, which I can pass through my leisure time instead of an immediate dialogue that takes away the user's experience.
W/dalvikvm( 9540): threadid=1: thread exiting with uncaught exception (group=0x2 aac87c8) E/AndroidRuntime( 9540): FATAL EXCEPTION: main E/AndroidRuntime( 9540): java.util.ConcurrentModificationException E/AndroidRuntime( 9540): at java.util.ArrayList$ArrayListIterator.next(Ar rayList.java:573)
the entire application dies with an exception dialog .. I would like to catch a ConcurrentModificationException from the global scope, so that if such an event occurs due to unknown circumstances, the entire application is not deleted ..
** EDIT **
while blocking this block during onSceneTouchEvent
try { postUpdate(new AddShapeImpl(scene, onX, onY)); } finally { }
It seems like I'm firing the block too fast, I think. I need to slow down the work.
* Follow Up *
It seemed to me that the problem was solved. I made one of them ...
if ( ballspawning == false) try { Log.v(DEBUG_TAG, "onSceneTouchEvent 1-1"); addnewball(scene, onX, onY); Log.v(DEBUG_TAG, "onSceneTouchEvent 1-2"); } finally { }
You will see that after I entered the ball with the Boolean flag, and the secondary procedure that I pass, my spawning grounds were so golden ... I made this field, and it is set at the end of my iteration and checked before the transverse list happens. . whoo hoo !! soo sweet!
there is no real need for global capture .. just a good old debugging. but I would still like to implement a global handler for all errors. Todo
I again caused a parallel error.
Screenshots
Debug Msgs
Other incident
screenshot 4
almost narrows the culprit
I tried to catch ConcurrentModificationException with
void uncaughtException(Thread t, Throwable e){ Log.v(DEBUG_TAG, "uncaughtException **********"); Log.v(DEBUG_TAG,"thread " + t + " Throwable" + e.toString()); }
as you can see in the last screenshot, the above method is never called.
The ConcurrentModificationException parameter splits the application into an exception dialog.
** Following actions **
I added
public class LauncherActivity extends E3Activity implements UncaughtExceptionHandler ,FPSListener,SceneUpdateListener
and at run time an additional Unimplimented Method
@Override public void uncaughtException(Thread t,Throwable e) { Log.v(DEBUG_TAG, "uncaughtException **************"); Log.v(DEBUG_TAG,"thread " + t + " Throwable" + e.toString()); }
and still does not contain exception capture ...
I also added
newThread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler(){ @Override public void uncaughtException(Thread t, Throwable e) { Log.v(DEBUG_TAG,"*************** ERROR! An exception occurred in " + t.getName() + ". Cause: " + e.getMessage()); } }); newThread.start();
and still not exciting ...
aaaa
WHoo hoo !!
Just caught the exception !! check the screenshot ... you will see !!!!!!
http://img17.imageshack.us/img17/135/concurrentmodificatione.png
Caught Exception
thanks all that made me work hard to figure out java exception handling!
Great resource
I caught the concurrency issue on
removal ...
Public class LauncherActivity extends E3Activity implements UncaughtExceptionHandler, FPSListener, SceneUpdateListener
that I had the original ... without implementing UncaughtExceptionHandler
and added a class that Johnny Lee described in great detail. blog.dimond.de/?p=63
Sweet stuff.