I'm receiving a package name in the notification and I want to open that particular app in play store once I click the notification. How to proceed with that?
Asked
Active
Viewed 400 times
1 Answers
1
You can simply use an implicit intent:
NotificationManager notificationManager = (NotificationManager) context
.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(icon, message, when);
Intent notificationIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + PACKAGENAME))
PendingIntent intent = PendingIntent.getActivity(context, 0,
notificationIntent, 0);
notification.setLatestEventInfo(context, title, message, intent);
notificationManager.notify(0, notification);
![](../../users/profiles/7765139.webp)
Levi Moreira
- 10,934
- 3
- 27
- 44