मैं एंड्रॉइड के अधिसूचना प्रबंधक का उपयोग करके अधिसूचना बनाने की कोशिश कर रहा हूं, हालांकि, चाल यह है कि मैं भविष्य में अधिसूचना 30 दिनों तक दिखाना चाहता हूं। मेरे कोड में मैं यह कर रहा हूं:एंड्रॉइड विलंबित अधिसूचना
Intent notificationIntent = new Intent(this, MyClass.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
long when = System.currentTimeMillis() + (30 * 24 * 3600 * 1000);
Notification notification = new Notification(R.drawable.some_image, "A title", when);
notification.setLatestEventInfo(getApplicationContext(), "You're late", "Some description", contentIntent);
NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
nm.notify(NOTIFY_ATTEND_ID, notification);
हालांकि, अधिसूचना अभी भी तत्काल दिखाई दे रही है। जो मैंने पढ़ा है, अधिसूचना कन्स्ट्रक्टर को "कब" पैरामीटर केवल स्टेटसबार में अधिसूचनाओं को क्रमबद्ध करने के लिए प्रयोग किया जाता है। क्या भविष्य में दिनांक/समय पर अधिसूचना दिखाने के लिए वैसे भी है? अग्रिम में धन्यवाद।
इसे भविष्य में 30 दिनों तक दिखाना मुश्किल नहीं है। अलार्म और ऐसे बूटअप पर मारे गए। आपको कॉमन्स सलाह के लिए धन्यवाद या कुछ – Falmarri