nicht löse ich das Problem haben, wenn der Benutzer drücken Sie die Mitteilung Aktivität offen ist, aber Benachrichtigung kann nicht in der Nähe mir meinen Code werden helfenKönnte die Benachrichtigungen in android
ist
NotificationManager mNotificationManager = (NotificationManager) getSystemService (Context .NOTIFICATION_SERVICE);
int icon = R.drawable.ic_launcher;
CharSequence tickerText = "Good Morning";
long time = System.currentTimeMillis();
Notification notification = new Notification(icon, tickerText, time);
Context context = getApplicationContext();
CharSequence contentTitle = "Title";
CharSequence contentText = "Text";
Intent notificationIntent = new Intent(this, NotificationManagerDemoActivity.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent,0);
notification.flags = Notification.FLAG_AUTO_CANCEL;
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
mNotificationManager.notify(1,notification);
Danke Es funktioniert Sav Achrya –
Abstimmung für Ihre Antwort. Groß. Ich habe das auch gemacht. –