IntentFilter onfilter = new IntentFilter(Intent.ACTION_SCREEN_ON);
registerReceiver(screenon, onfilter);
BroadcastReceiver screenon = new BroadcastReceiver() {
  public static final String Screenon = "android.intent.action.SCREEN_ON";
  public void onReceive(Context context, Intent intent) {
   if (!intent.getAction().equals(Screenon)) return; 
// 여기에 전원 버튼을 눌렸을때  // 어떠한 일을 할건지 결정하면됩니다
 }
 };


전원 버튼 클릭시 이벤트 하는것 했습니다.

 

문제는 전원버튼을 눌러 스크린이 켜지면서 이벤트를 받는거든지

카톡의 화면 꺼짐상태에서 메시지 팝업 을 통해 스크린이 켜지든지 똑같이 이벤트를 받더군요...

 

저는 전원 버튼을 눌렀을 때만 이벤트를 주고싶어요... 할수 있는 방법이 있을까요?