Answers for "restart android app"

5

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
2

how to restart activity in android

restart.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                recreate();
            }
        });

    }
Posted by: Guest on November-19-2020
0

restart android emulator

emulator @avd_name -no-snapshot-load
Posted by: Guest on August-05-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language