There are 2 activations in the application - auth and dialogs. I am trying to prevent the user from returning from dialogs to auth. The first thing that comes to mind is the exit from the application by pressing the back button (on the bottom panel). I use the following code:
public void onDestroy() { moveTaskToBack(true); super.onDestroy(); System.runFinalizersOnExit(true); System.exit(0); } There are 2 problems:
1) When you press back, the previous activity still appears for a moment, and only then the application closes.
2) I read on the forums that using System.exit (0); not recommended, but did not find an alternative.
Help to deal with the situation.