मुझे एक कार्यक्रम की आवश्यकता है जो एंड्रॉइड पर एक अधिसूचना जोड़ देगा। और जब कोई अधिसूचना पर क्लिक करता है, तो उसे मेरी दूसरी गतिविधि तक ले जाना चाहिए।
मैंने कोड स्थापित किया है। अधिसूचना काम कर रही होनी चाहिए, लेकिन किसी कारण से यह काम नहीं कर रही है। Notificationसब पर नहीं दिख रहा है। मुझे नहीं पता कि मैं क्या याद कर रहा हूं।
उन फ़ाइलों का कोड:
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);
Activityलॉन्च नहीं किया जा रहा है? हैNotificationनहीं दिखा रहा है?