Activity stays on Android screen

I have a service that listens to some events. When this event occurs, it displays the default screen. Activation (intention)

When the user finishes doing something on this screen, the code calls finish () but instead of “closing” the full application, it shows the main / launch activity.

I mean, what is the best way to remove all application screens from the current view? or any way around this?

+3
source share
3 answers

The method finish()only completes the action from which it called.

, , startActivity(intent). , , .

+3

overkill... quit()

int pid = android.os.Process.myPid();
android.os.Process.killProcess(pid);
System.exit(0);
finish();
+1

Source: https://habr.com/ru/post/1753698/


All Articles