我能够在API 24的UncaughtExceptionHandler中启动活动;但是,它在API 26上不起作用。我试图了解为什么它不起作用?
谢谢
编辑:
private Thread.UncaughtExceptionHandler _unCaughtExceptionHandler =
new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable ex) {
final Intent intent = new Intent(getContext(), SomeActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
}
};