I want to create Notification , which when clicked opens with my application on the Android market.
I tried a few things as shown below:
NotificationCompat.Builder builder = new NotificationCompat.Builder(application); builder.setAutoCancel(true); // (set titles, icon, ...) Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("market://details?id=com.android.example")); builder.setContentIntent(PendingIntent.getActivity(application, 0, intent, 0)); Notification notification = builder.build(); NotificationManager manager = (NotificationManager) application.getSystemService(Context.NOTIFICATION_SERVICE); manager.notify(0, notification);
However, when clicked, nothing happens. Anyone who knows how to make this work?
foens
source share