Shashank Degloorkar
Shashank Degloorkar

Reputation: 3221

when user clicks on my notification i want to show an AlertDialog there

how can i show an AlertDialog in my activity, when the notification is clicked in notification area. plz help.... i'm using multiple status bar notifications each with unique IDS.

Upvotes: 1

Views: 221

Answers (2)

k3v
k3v

Reputation: 1189

I've solved a similar problem by having the notification intent open a new activity with a transparent background. The activity then spawns the AlertDialog.

Upvotes: 1

Dennis Winter
Dennis Winter

Reputation: 2037

Put some data to signal that an AlertDialog should be shown into a PendingIntent and put this into yourNotification.contentIntent of your notification. Display the AlertDialog from your Activity in case it receives this Intent.

Have a look at the Notifications Doc.

Upvotes: 0

Related Questions