Benachrichtigung Nicht öffnen Acivity onCLick

Möchte ich eine Meldung erstellen, die sollte Aktivität öffnen, wenn Sie klicken Sie auf es. Aber wenn ich auf die Benachrichtigung Tätigkeit nicht öffnen .
Jede Hilfe würde geschätzt werden .Hier ist mein code:

NotificationManager notificationManager = (NotificationManager) context
            .getSystemService(Context.NOTIFICATION_SERVICE);





    Intent intent = new Intent(context, MessageReceivedActivity.class);
    intent.putExtra("payload", payload);
    intent.setAction(Long.toString(System.currentTimeMillis()));
    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
    PendingIntent pendingIntent = PendingIntent.getActivity(context, 0,
            intent, PendingIntent.FLAG_CANCEL_CURRENT);



    Notification.Builder notification = new Notification.Builder(context)


    .setContentTitle("Message Received")
    .setSmallIcon(R.drawable.icon)
    .setContentText(payload)
    .setContentIntent(pendingIntent)
    .setAutoCancel(true);






    Notification notificationn = notification.getNotification();

    notificationManager.notify(0, notificationn);
InformationsquelleAutor User42590 | 2013-04-13
Schreibe einen Kommentar