Closing app that are in the background

0

Well, how do I close an application, not leaving it in the background but ending the process!

    
asked by anonymous 02.06.2017 / 21:05

1 answer

1

Second this , you can do something like this:

@Override
public void onBackPressed() {

    android.os.Process.killProcess(android.os.Process.myPid());
    // a linha acima mata o processo
}

PS: There it says that this will not kill the task in memory, but it kills the process, so I think it works

    
02.06.2017 / 21:09