Я хочу установить свое уведомление в android в определенную дату и время, я пытаюсь использовать его с помощью даты в java, но мое уведомление увольняется до времени. так что я могу пойти, чтобы уволить его в указанное время. Заранее спасибо!Как начать уведомление в пользовательское время?
Вот мой код для уведомления:
Calendar cal = java.util.Calendar.getInstance();
cal.set(2012, 00, 30);
Date date = cal.getTime();
date.setHours(17);
date.setMinutes(30);
date.setSeconds(15);
long time = date.getTime();
Log.e("date is",""+date);
long when = time;
Notification notification = new Notification(notificationIcon,tickerText,date.getTime());
notification.when = date.getTime();
RemoteViews contentView = new RemoteViews("com.LayoutDemo",R.layout.userscreen);
notification.contentView= contentView;
Intent intent = this.getIntent();
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, intent, 0);
notification.contentIntent= contentIntent;
notification.flags= Notification.FLAG_AUTO_CANCEL;
int NOTIFICATION_ID =1;
nManager.notify(NOTIFICATION_ID,notification);
Ok спасибо !! Есть ли у вас какие-либо идеи о том, как начать обслуживание для уведомления о посеве? –