Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all articles
Browse latest Browse all 7191

Restarting Application after crash on android 10+

$
0
0

I am using this code in an exception handler setting it as my default exception handler in my oncreate functionit is working on version 9 and less but not higher than that

Intent intent = new Intent(activity, ActivitySplash.class);        Log.w("excCaught", ex.toString());        intent.putExtra("crash", true);        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP                | Intent.FLAG_ACTIVITY_CLEAR_TASK                | Intent.FLAG_ACTIVITY_NEW_TASK);        PendingIntent pendingIntent = PendingIntent.getActivity(MyApplication.instance.getBaseContext(), 0, intent, PendingIntent.FLAG_ONE_SHOT);        AlarmManager mgr = (AlarmManager) MyApplication.instance.getBaseContext().getSystemService(Context.ALARM_SERVICE);        mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, pendingIntent);        activity.finish();        System.exit(2);

IS there a newer version to use the needed code ? or is there something that must be added in Manisfest for newer versions

allowBackup is true and supports RTLS


Viewing all articles
Browse latest Browse all 7191

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>