मैं एक ऐप्लिकेशन है जो उपयोगकर्ता यह तय करें कि समय हर रोज उसे अधिसूचना के साथ कुछ याद दिलाना चाहता है चलो करना चाहते हैं ...सूचनाएं हर दिन एंड्रॉयड
मैं चाहूँगा पता है कि कैसे मैं माना जाता हूँ विशिष्ट समय में अधिसूचना को ट्रिगर करने के लिए उपयोगकर्ता 7:00 बजे से पहले चाहता है और उसे अधिसूचना पर टैप कर सकता है और विशिष्ट गतिविधि में आवेदन दर्ज कर सकता है। लेकिन जब उपयोगकर्ता कोई और अधिसूचनाएं प्राप्त नहीं करना चाहता (एक बटन क्लिक के साथ) मैं सभी अधिसूचनाओं को कैसे रद्द कर सकता हूं ...?
मैं अब तक की तरह
Intent intent = new Intent(this, main.class);
Bundle bundle = new Bundle();
bundle.putString("title", "Some Title");\
intent.putExtras(bundle);
PendingIntent pi = PendingIntent.getActivity(this, 0, intent, 0);
String body = "Tap to see the Activity";
String title = "Title of notification";
Notification n = new Notification(R.drawable.ic_launcher, body, System.currentTimeMillis());
n.setLatestEventInfo(this, title, body, pi);
n.defaults = Notification.DEFAULT_ALL;
nm.notify(uniqueID, n);
कुछ है, लेकिन कोई किस्मत बना दिया ....
धन्यवाद ...
< < >>
मैं इस
कर रहा हूँ String ns = Context.NOTIFICATION_SERVICE;
NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
int icon = R.drawable.notification_icon;
CharSequence tickerText = "Ome TickerText";
long when = System.currentTimeMillis();
Context context = getApplicationContext();
CharSequence contentTitle = "Some Title";
CharSequence contentText = "Some Text";
Intent notificationIntent = new Intent(context, LandingActivity.class);
Bundle bundle = new Bundle();
bundle.putString("title", "a title");
bundle.putString("title2", "title number 2");
bundle.putString("action", "tip");
bundle.putString("greek", "somehting else");
bundle.putInt("action_num", 2);
notificationIntent.putExtras(bundle);
alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
contentIntent = PendingIntent.getActivity(Notifications.this, 0, notificationIntent, 0);
Notification notification = new Notification(icon, tickerText, when);
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
notification.defaults = Notification.DEFAULT_ALL;
mNotificationManager.notify(UniqueID, notification);
int hour = tp.getCurrentHour();
int minutes = tp.getCurrentMinute();
contentIntent = PendingIntent.getService(Notifications.this, 0, notificationIntent, 0);
AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
calendar.set(Calendar.HOUR_OF_DAY, hour);
calendar.set(Calendar.MINUTE, minutes);
calendar.set(Calendar.SECOND, 00);
alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), contentIntent);
लेकिन कोई भाग्य नहीं ...
कोई मदद कृपया?
मैं कुछ समय पर दैनिक प्रदर्शित करने से पहले जांच करने के लिए स्थिति का उपयोग कैसे कर सकता हूं, भले ही ऐप बंद हो – Si8