How to complete the work in this case?

We all know that pressing the "Back" button on the device does not kill the application, it simply terminates (destroys) the action that is performed in the foreground.

Well, I came across some code that helps me capture the signal of the back button so that I cannot exit the application. The only way to get out of it in such cases is to press the home key.

Now this situation presents me with a unique flaw! The inability to kill to terminate the application at any time at its discretion allows the application to run in the background, as nothing has changed.

So, in such cases, the task manager is my only friend, or is there a way that I can otherwise kill this application?

PS: if there is a flaw in my understanding of what happens when the home button is pressed, I would gladly fix it ... =)

+3
source share
2 answers

It is impossible to kill the application with standard buttons, neither the back button nor the home button. Your application will be suspended if it is not a service and will be sent to the background, and it will look like it is jamming memory, but if the application does not have tasks performed by the application, it is fine and will not use any resources that necessary for other processes.

, "" onPause . , . , .

, , . , . android android, , . Android .

+3

, , : finishOnTaskLaunch = "true" . Android .

+3

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


All Articles