Answers for "restart application programmatically android"

2

restart application programmatically android

Intent mStartActivity = new Intent(context, StartActivity.class);
int mPendingIntentId = 123456;
PendingIntent mPendingIntent = PendingIntent.getActivity(context, mPendingIntentId,    mStartActivity, PendingIntent.FLAG_CANCEL_CURRENT);
AlarmManager mgr = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, mPendingIntent);
System.exit(0); //you can also kill your app's process
Posted by: Guest on March-16-2020

Code answers related to "restart application programmatically android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language