1

When a notification appears in the Android notification bar, the action for tapping on it is defined by the PendingIntent that was used while creating it, right?

But instead of launching an activity when the user taps on the notification, I would rather like to show an AlertDialog only. Is this possible?

The AlertDialog should ask: "Close notification" or "Show again in 1h" and so on.

Is there a way to show this AlertDialog only or do I have to launch an Activity, anyway?

caw
  • 30,999
  • 61
  • 181
  • 291
  • 1
    http://stackoverflow.com/questions/7313852/android-how-can-i-launch-a-popup-dialog-from-an-notification-or-long-pressed-se – Luke Taylor Aug 15 '12 at 14:50

1 Answers1

2

You have to make an activity that does not set a contentView and just pops the Dialogue. And remember to finish(); the activity when the dialogue is dimissed.

Budius
  • 39,391
  • 16
  • 102
  • 144