안드로이드 개발 질문/답변
(글 수 45,052)
Noti extends Activity 클래스 에서 반복알람으로 BroadcastReceiver 를 호출하여 notification 을 수행하는 어플을 개발중입니다.
절전모드에서도 소리나 진동은 되는데 화면이 켜지지가 않습니다.
겔럭시S에서 개발중이고 화면에 불이 들어오게 해결법좀 알려주세요..
브로드캐스트에서 화면 제어가 안되나요 ???
답변 부탁드립니다~
Noti.java ---- (extends Activity)
AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);
Intent intent = new Intent(Noti.this, AlarmReceiver.class);
PendingIntent sender = PendingIntent.getBroadcast(Noti.this,0,intent,0);
Date t = new Date();
t.setTime(System.currentTimeMillis() + 10 * 1000); //지금시간에서 10초 이후부턴 반복
am.setRepeating(AlarmManager.RTC_WAKEUP, t.getTime(), 10*1000, sender);
AlarmReceiver.java ---- (extends BroadcastReceiver)
NotificationManager mNotiManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
Notification noti = new Notification(R.drawable.noti_mail,"새알림",System.currentTimeMillis());
noti.defaults = Notification.DEFAULT_VIBRATE
| Notification.DEFAULT_LIGHTS
| Notification.DEFAULT_SOUND;
noti.flags = Notification.FLAG_AUTO_CANCEL;
Intent i = new Intent(context,GroupwarePortal.class);
//클릭시 이동
PendingIntent content = PendingIntent.getActivity(context, 0, i, 0);
//노티창에 표시해줄 글자
noti.setLatestEventInfo(context, "새 알림", "알림이 도착했습니다.", content);
mNotiManager.notify(MAIL_NOTI,noti);
절전모드에서도 소리나 진동은 되는데 화면이 켜지지가 않습니다.
겔럭시S에서 개발중이고 화면에 불이 들어오게 해결법좀 알려주세요..
브로드캐스트에서 화면 제어가 안되나요 ???
답변 부탁드립니다~
Noti.java ---- (extends Activity)
AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);
Intent intent = new Intent(Noti.this, AlarmReceiver.class);
PendingIntent sender = PendingIntent.getBroadcast(Noti.this,0,intent,0);
Date t = new Date();
t.setTime(System.currentTimeMillis() + 10 * 1000); //지금시간에서 10초 이후부턴 반복
am.setRepeating(AlarmManager.RTC_WAKEUP, t.getTime(), 10*1000, sender);
AlarmReceiver.java ---- (extends BroadcastReceiver)
NotificationManager mNotiManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
Notification noti = new Notification(R.drawable.noti_mail,"새알림",System.currentTimeMillis());
noti.defaults = Notification.DEFAULT_VIBRATE
| Notification.DEFAULT_LIGHTS
| Notification.DEFAULT_SOUND;
noti.flags = Notification.FLAG_AUTO_CANCEL;
Intent i = new Intent(context,GroupwarePortal.class);
//클릭시 이동
PendingIntent content = PendingIntent.getActivity(context, 0, i, 0);
//노티창에 표시해줄 글자
noti.setLatestEventInfo(context, "새 알림", "알림이 도착했습니다.", content);
mNotiManager.notify(MAIL_NOTI,noti);