Intent.FLAG_ACTIVITY_NEW_TASK

I am at some point and time when the application is not actively displaying a dialogue (activity with the theme of the dialogue, otherwise there is no way to do it).

if (!Utils.isApplicationInForeground(context)) { Intent i = new Intent(context, DialogActivity.class); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(i); } 

Intent.FLAG_ACTIVITY_NEW_TASK => therefore, when I launch the application after opening the dialog using the "Home" button (recent applications), DialogActivity opens instead of the application.

How can I open the application?

+7
source share
1 answer

stupid idea, since I don’t know what your goal is, but it will work well

in DialogActivity.class ,

onResume() override method something like

 @Override protected void onResume() { DialogActivity.this.finish(); super.onResume(); } 
-one
source

All Articles