• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps App wont exit correctly

VaMoose

Lurker
Hi There.

I am building an app called spam, it is a mini game.

But when I try to kill the program with
System.exit(-1);
It comes to a menu saying Accessibility Settings. and not to the menu screen like it should. How do I fix this?

Thanks,
Josh
 
System.exit shouldn't be used in Android development. To forcefully close an application, you should use, instead:

Code:
int pid = android.os.Process.getUidForName("package name here");
android.os.Process.killProcess(pid);
 
Back
Top Bottom