Necesito un programa que agregue una notificación en Android. Y cuando alguien hace clic en la notificación, debería llevarlos a mi segunda actividad.
He establecido un código. La notificación debería estar funcionando, pero por alguna razón no funciona. No Notificationse ve en absoluto. No sé qué me estoy perdiendo.
Código de esos archivos:
Notification n = new Notification.Builder(this)
.setContentTitle("New mail from " + "test@gmail.com")
.setContentText("Subject")
.setContentIntent(pIntent).setAutoCancel(true)
.setStyle(new Notification.BigTextStyle().bigText(longText))
.build();
NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
// Hide the notification after it's selected
notificationManager.notify(0, n);
ActivityNo se está lanzando? ¿NotificationNo se muestra?