anarche wrote:Can't you catch the exception and exit back to the earlier state?
It is impossible. You can't catch exceptions in the child activities from the parent one even if both is yours. In the case of third-party activities like the Camera they are runs in the another VM in separate process at all.
The only way I realized to fight the issue is a check for the onActivityResult()
occur before onResume()
in the parent activity. Documentation for onActivityResult()
states than it will occur immediately before onResume()
. So if after we call startActivityForResult()
and get onResume()
prior it we consider child activity being crashed and do things just like we are receive the RESULT_CANCELED
directly. It is ugly hack and I do not like it extremely but no other way I was able to realize to resolve the issue.
Maybe you have other ideas ?
Thanks in advance