<分区>
我在通知中收到了一个包名称,我想在单击通知后在 Play 商店中打开该特定应用程序。如何进行?
<分区>
我在通知中收到了一个包名称,我想在单击通知后在 Play 商店中打开该特定应用程序。如何进行?
最佳答案
您可以简单地使用隐式 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);
关于android - 在通知点击时打开特定应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49988972/