Because my application is fully dependent to SD memory, I want to close my application when SD card removed. I can find out when SD card removed but when I want to close my application using
System.exit(0)
application doesn't close and this error shown in my activity
appname isn't responding. Do you want to close it?
I guess its waiting for some processes to close. how can I fully close my application like in Task Manager. This is my code:
ActivityManager am = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
am.killBackgroundProcesses("packegename");
System.runFinalizersOnExit(true);
System.exit(0);
Can anybody help me
UPDATE : I should say that I have two services running in background