starting activity on uncaughtException() call

后端 未结 1 496
心在旅途
心在旅途 2021-01-03 08:13

I want to start a new activity from my UncaughtExceptionHandler when an uncaught exception appears. Is this possible?

I think the current activity can\'

相关标签:
1条回答
  • 2021-01-03 08:41

    What you will need to do is specify your exception display Activity in your manifest file and set android:taskAffinity and android:process to values different from your main process. Then you'll need to specify an intent filter and use that to start the activity and pass the data.

    By default the taskAffinity is inheried from the main <application> tag and is the same page name set in the <manifest> tag. You probably want something like android:taskAffinity="org.example.package.TASK.ExceptionDisplay"

    By default everything in one <application> tag runs in the same process. You can change that using the android:process attribute you probably want something like android:process=":exception_process".

    Check out this documentation for more details.

    0 讨论(0)
提交回复
热议问题