So I have my Activity, and on pressing a "Quit" button I call Activity.finish(). This effectively closes my application.
The problem: The Dalvik-process of my application is still hanging around as a zombie in background. It seems like this is normal as other applications do the same. Even The hello-world example hangs around in memory..
I could live with this, but unfortunatley this behaviour makes the development of my application a pain. I have a remote service connected to my Activity, and this service won't unload until my Activity unloads (which as said it never does).
Everything is somehow kept alive for no good reason.
How can I really remove my Activity from memory?
I'm looking for something like Activity.finish_and_kill_my_process_please() call or something similar.
android.os.Process.killProcess(android.os.Process.myPid());
public void onDestroy() {
super.onDestroy();
android.os.Process.killProcess(android.os.Process.myPid());
}