By killing the application, Android is going right in this process.?

I have seen many applications for task killers that claim to kill applications in the background, but as soon as I use them, I find out that what they do just disappears from the list of applications and deceives the user that they are killed .

If I open the same task killer application again in a matter of seconds, the same application will appear again, which was said to be killed earlier. Now is this an application error or an Android OS?

Not only here, even if applications have the "Exit" option, I noticed that pressing the exit button does not exit. So where is the problem?

I read a long time ago that in Android there is no function to kill the application (I do not know about the current time). So will the OS be to blame? Is there another way to close the application when we want and make it behave normally?

+6
source share
2 answers

Not only here, even with applications that have the Exit option, I noticed that pressing the exit button does not exit. So where is the problem.?

If the application is designed correctly, the exit option should kill it. But the presence of the "Exit" option in Android is not supported.
You can kill an action using finish (). The application is a combination of actions, therefore, if all actions are correctly killed, the application will not work in my understanding. I could be wrong.

I read a long time ago that in Android there is no function to kill the application (I do not know about the current time). So the OS will be guilty.?

From what I know, there is no official to kill the application right away. But there are some hacks that allow you to immediately kill all the actions.

Is there a way to close the application whenever we want and make it behave normally.?

Well, the next hack works well for me.

Close all previous steps as follows:

Intent intent = new Intent(this, MainActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.putExtra("Exit me", true); startActivity(intent); finish(); 

Then, in the MainActivity onCreate () method, add this to complete MainActivity

 setContentView(R.layout.main_layout); if( getIntent().getBooleanExtra("Exit me", false)){ finish(); return; // add this to prevent from doing unnecessary stuffs } 
+1
source

While Ninjas answer provided an opportunity to close many actions on the stack, please note that the Android method was created, the application cannot directly interact with another ... this is how the security function blocks most unnecessary programs, as well as malwares / virus / etc .d.

The only real way to force the application to close is to block resources for it (using the Android Settings tool to put the application in the β€œnot running” state), or switch to the next system (mainly Linux) and refuse resources, this trick but possible.

If I open the same task killer application again in a matter of seconds, the same application will appear again, which was said to be killed earlier. Now is this an application error or an Android OS?

This is an OS error, but it behaves EXACTLY as expected. No program can modify / edit your program. Like the ninja, he basically asked the system to ignore any actions on this stack. But if multi-level stacks are present ... well ... no, then this is an APP error.

Not only here, even if applications have the "Exit" option, I noticed that pressing the exit button does not exit. So where is the problem?

A programmer should NOT leave his application, because its not a complete program, you basically execute commands inside another program, so the rules must be followed. Once you get started, memory management is not in your hands, so you cannot / should not "exit" applications.

Is there another way to close the application when we want and make it behave normally?

I do not understand this. In the application life cycle, everything either behaves normally (or you know, stopped: example stopped working), or in a ready state

0
source

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