2

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?

0

1 Answer 1

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);

Not the answer you're looking for? Browse other questions tagged or ask your own question.