开发者

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

开发者 https://www.devze.com 2023-03-14 11:30 出处:网络
how can i show an AlertDialog in my activity, when the notification is clicked in notification area. plz help....

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 notificati开发者_如何学Cons each with unique IDS.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消