我有一个名为的函数show_notification(),当用户点击按钮时我会调用它.关键是,一旦他点击[如下面的函数],我不想显示通知,我想在特定的time= hours:mins
地方显示此通知.小时和分钟是两个整数,具有我想要的时间值[例如小时= 22和分钟= 40 ..意思是在22:40 [10:40 pm]发出此通知.顺便说一句,这个警报应该每天同时重复.
public void show_notification() {
CharSequence notify_msg="Don't foget!";
CharSequence title= "you ve been notified by My app";
CharSequence details= "It works!";
NotificationManager nm= (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Notification notify= new Notification(android.R.drawable.stat_notify_more,
notify_msg,
System.currentTimeMillis());
Context mycontext= ActA.this;
Intent myintent= new Intent (mycontext, ActA.class);
PendingIntent pending= PendingIntent.getActivity(mycontext, 0, myintent, 0); ///0's are not applicable here
notify.setLatestEventInfo(mycontext, title, details, pending);
nm.notify(0, notify);
}
我希望你能详细回答,因为我是一个非常新的开发者.