I have an application with many activities, sharing the same Menu, which is created in a code module. This Menu has an option "Exit". How do I finish all running activities without using ExitApplication? Do I have to create a variable in the code module (ExitNow as boolean) and check it in every Activity_Resume of every activity?
Finish all activities in Basic4Android
5.4k Views Asked by adamioan At
4
There are 4 best solutions below
0
On
try this one.
Intent intent = new Intent(getApplicationContext(), Home.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
put activity.finish as the code for your exit button