I am building an app which uses either some activities in which the user can navigate or uses one specific activity which starts the app when a deeplink is used. In this DeeplinkActivity I have a button with which the app should exit the entire app and not put it into the background. I tried the following code, which only closes the app, but it still remains in the background?!
public void onStopButton(View view) {
log.info("UI -> Stop this app");
// this.finishAffinity();
android.os.Process.killProcess(android.os.Process.myPid());
// finish();
System.exit(0);
}
I tried all kinds of suggested combinations, but none of them really exits the app. Anybody have some other (working) code suggestions? I have set minSdkVersion=19 and targetSdkVersion=26