Here is my Code : Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler () {
@Override public void uncaughtException(Thread thread, Throwable exc){ cThread = thread; cThrowable = exc; runOnUiThread(new Runnable() { @Override public void run() { showDialog(UNCAUGHT_ERROR); } }); } }); Contorl never goes to oncreatedialog(). the above lines of code I have put in oncreate() of an activity. Am I missing any thing? Once this is sovled then next question I have is How could I force close the application? Please help. Thanks Irfan On Sep 8, 3:11 pm, Iroid <irfan.f.k...@gmail.com> wrote: > Thanks Mark, > I used handler, which did not work for me. Let me try with > runOnUiThread(). > > On Sep 8, 3:04 pm, Mark Murphy <mmur...@commonsware.com> wrote: > > > > > Iroid wrote: > > > Hello all, > > > > In my current application I want to show a dialog having "Force Close" > > > and "Report" option at the time of Unhandled Exception. > > > > Could anyone please let me know how to have this dialog? > > > right now if I change defaultExceptionHandler to mine It gets control > > > but I am not able to show any dialog after that. I guess UI thread is > > > already closed by the time handler gets control. > > > No, I think you are going about this correctly. However, you may not be > > called on the UI thread, so you need to use runOnUiThread() or something > > to arrange for your dialog to be opened on the UI thread. Leastways, > > that approach has worked for me. > > > -- > > Mark Murphy (a Commons > > Guy)http://commonsware.com|http://twitter.com/commonsguy > > > _The Busy Coders' Guide to *Advanced* Android Development_ In Print!- Hide > > quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---