I found some code to press home button from code
Intent startMain = new Intent(Intent.ACTION_MAIN);
startMain.addCategory(Intent.CATEGORY_HOME);
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(startMain);
and This one :
moveTaskToBack(true);
I have a activity that is in single task
And a alertDialog with a button then you click on the button one of those code run and go to home
so when you go to app again the alert dismissed before
I want to relaunch the app without dismissing alertDialog
What can i do?
thanks
AlertDialog default button will dissmis dialog . you should create custom dialog with custom view
and layout dialog_custom can be designed by yourself too but this is my layout file for custom dialog