show_notification()
ユーザーがボタンを押したときに呼び出す関数があります。ポイントは、[以下の関数のように] クリックしたら通知を表示する代わりに、特定のtime= hours:mins
時間と分でこの通知を表示したいということです [たとえば、時間 = 22 と時間 = 22 とminutes=40..つまり、この通知を 22:40 [午後 10:40] に起動します]。ちなみに、このアラームは毎日同じ時刻に繰り返す必要があります。
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);
}
私は非常に新しい開発者であるため、詳細に回答していただければ幸いです。