restart application programmatically android

Solutions on MaxInterview for restart application programmatically android by the best coders in the world

showing results for - "restart application programmatically android"
Neele
30 Nov 2019
1Intent mStartActivity = new Intent(context, StartActivity.class);
2int mPendingIntentId = 123456;
3PendingIntent mPendingIntent = PendingIntent.getActivity(context, mPendingIntentId,    mStartActivity, PendingIntent.FLAG_CANCEL_CURRENT);
4AlarmManager mgr = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
5mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, mPendingIntent);
6System.exit(0); //you can also kill your app's process