How can you programmatically close all activities except the main one?

  • maybe help - TimurVI

1 answer 1

That's right.

Intent intent = new Intent(getApplicationContext(), HomeActivity.class); ComponentName cn = intent.getComponent(); Intent mainIntent = IntentCompat.makeRestartActivityTask(cn); startActivity(mainIntent);