Basically, I want to bring the dialogue to the forefront from the background service (I know that using a notification will be more convenient for the user, but my application really needs an immediate response from the user). I have a job. Then I define the action containing the dialog using android:theme="@android:style/Theme.Translucent.NoTitleBar" .
In the utility code, I start the dialog operation as follows:
Intent intent = new Intent(getApplicationContext(), PopUpDialogActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent);
A dialog may appear if I'm in my application. But if I am not in my application, the dialogue does not appear in the foreground (I must enter my application to see it). How can I run it directly in user focus?
source share