0

When exiting my app, the app is still cached in the background. How can I prevent this or release it from cache when exiting ?

enter image description here

Please do only answer, if you have a solution or hint . I have my reasons for doing this, so please don't ask counterquestions like "why do you want doing this ?" or "let the os doing the memory management" :-)

I am exiting the app by calling

finish();
mcfly soft
  • 11,289
  • 26
  • 98
  • 202

1 Answers1

0

To Quit Application on Button click use this code :

Intent intent = new Intent(Intent.ACTION_MAIN);
 intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivity(intent);

    int pid = android.os.Process.myPid();
    android.os.Process.KillProcess(pid);
Mayank Saini
  • 3,017
  • 24
  • 25
  • 1
    you are just calling home via intent. How is it different from calling another activity's intent. i dont think the app will close. instead it will minimize. – SMR Feb 20 '14 at 12:49
  • @Mayank Saini. This was the wrong answer ( it was not me that give -2 points :-) ). Do the answer with the killing process that was also mentoined in the link. Then I can accept it. – mcfly soft Feb 20 '14 at 13:07
  • I guess you could remove the Intent Part of your answer ? – mcfly soft Feb 20 '14 at 13:21