사용자가 단추를 눌렀을 때 호출하는 show_notification()
이라는 함수가 있습니다. 요점은 [아래 함수에서와 같이] 클릭 한 번으로 알림을 표시하는 것입니다. 특정 알림에이 알림을 표시하고 싶습니다. time= hours:mins
시간과 분은 원하는 시간 값을 갖는 두 개의 정수입니다 [예 : 시간 = 22, 분 = 40 .. 22:40 [10:40 pm]에이 알림을 발합니다. 그런데이 알람은 매일 같은 시간에 반복되어야합니다.android : 특정 시간에 알림을 표시 하시겠습니까?
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);
}
저는 아주 새로운 개발자이므로 자세한 내용을 알려주십시오.
자습서 나 예제에 대한 링크가 있습니까? 감사합니다 :) – CSawy
http://android-er.blogspot.in/2010/10/simple-example-of-alarm-service-using.html - 알림으로 토스트를 바꿀 수 있습니다 –
몇 가지 흥미로운 예가 있습니다. 이 페이지에서 알람 관리자로 할 수있는 흥미로운 것들. –