I have an application with multiple activities. On one of them, I set up an alarm. I press the HOME button. When the alarm is triggered, a notification appears. When clicking on the notification, I start a dialogue-like Activity (@android:style/Theme.Dialog). Although I am on the desktop screen, Android opens my last activity and then shows my dialogue-like activity on top of that. I just want to show my dialogue activity wherever the user is.
Does anyone have an idea of what is wrong?
Intent notificationIntent = new Intent(this, NotificationActivity.class);
notificationIntent.putExtra(Constants.EXTRA_ALERT_MESSAGE, contentText);
PendingIntent contentIntent = PendingIntent.getActivity(this, Constants.PENDING_INTENT_REQ_DIALOG, notificationIntent, 0);
no.contentIntent = contentIntent;
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…