On Jun 28, 7:37 pm, TreKing <treking...@gmail.com> wrote: > On Wed, Jun 23, 2010 at 7:57 AM, Alexey Kryshen <a.krys...@gmail.com> wrote: > > If child activity started by the startActivityForResult() exit by > > unexpected exception the > > onActivityResult() is not called and I have no any ideas how can I handle > > this to get application working in a fail-safe manner ? > > You can register an uncaught exception handler to catch any exceptions that > are not otherwise handled properly.
How you can register uncaught exception handler for third-party activity if latter even runs in the another VM in separate process. It is impossible, isn't ? > > > When my code runs child activity with startActivityForResult() it awaits > > until onActivityResult() will be invoked to get working further, but > > onActivityResult() is not calling and my code is "hang- up" (logically). > > This is strange. AFAIK, if any activity in your stack crashes, your who > Application comes down with it. You should not be "stuck", especially since > startActivityForResult() doesn't block - it just starts the child activity > then waits for a return value in onActivityResult(). Unless you're doing > something that prevents the app from functioning until a valid response is > obtained. > Activities stack doesn't mean all activity runs in your process. Camera runs in separate process because it is another application at all. And you are somehow wrong with my application "stuck". It is logical "stuck" - application is an state machine and after Picture requested it is in the "Awaiting picture" state and only way to leave that state is to receive onActivityResult() to go further. But latter is not invoked and application logically "stuck" in the "Awaiting picture" state. The activity itself is normally worked, GUI thread is not blocked but application awaiting response on startActivityForResult() forever. It is a problem naturally. I have already implement an "hack" to workaround the issue but not happy with it. The hack itself exploit the other fact from documentation that onActivityResult() must be invoked immediately before onResume(). If startActivityForResult() was called and my activity receive onResume() without onActivityResult() prior it I have consider this like receiving RESULT_CANCELED. It is resolve the issue but naturally looks like ugly hack. Any other ideas ? > ------------------------------------------------------------------------------------------------- > TreKing - Chicago transit tracking app for Android-powered > deviceshttp://sites.google.com/site/rezmobileapps/treking -- 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