When sending a message to my android app using google cloud messaging I can\'t figure out how to open a yes or no dialog (like a javasrcript confirm box) that opens a websit
Try this working, In GCMIntentService write the above code in generate notification
private static void generateNotification(Context context, String message) {
long when = System.currentTimeMillis();
NotificationManager notificationManager = (NotificationManager) context
.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(R.drawable.appicon,
message, when);
String title = context.getString(R.string.app_name);
Intent notificationIntent = new Intent(context,
YourClassName.class);
// set intent so it does not start a new activity
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent intent = PendingIntent.getActivity(context, 0,
notificationIntent, 0);
notification.setLatestEventInfo(context, title, message, intent);
notification.flags |= Notification.FLAG_AUTO_CANCEL;
notificationManager.notify(0, notification);
}
when click the notification it goes to the activity in your application, after that in the activity you may create the dialog-box and whatever you want put inside your activity