ACTION_TIME_TICK 이라는 브로드캐스트를 연습할 때,


스탭1:


 protected void onResume() {
  super.onResume();
  IntentFilter iFilter = new IntentFilter();
 iFilter.addAction(Intent.ACTION_TIME_TICK);

 registerReceiver(br, iFilter);

}




스탭2:


  public void onReceive(Context context, Intent intent) {

   String action = intent.getAction();
   String toastContent = "\n추가 노";   
   
   if (action.equals(Intent.ACTION_TIME_TICK))
              toastContent = "비행기모드 바뀜 \n";

          edtBattery.append(toastContent);

}



땡인데,






어떤 브로드캐스트 "ACTION_BOOT_COMPLETED"를 연습할 때는



스탭1:


public class AAAA extends 브로드캐스트 {

private static final strign TAG = "AAAA";

 protected void onReceive() {

 Log.i(TAG,intent.getAction());
}

}





스탭2:


메니페스트에

<user-permission ACTION_BOOT_COMPLETED

도 기술하고

<receiver android:name=".AAAA">

<intent-filter>

여기에도 기술하고..

</intent-filter>


해서 구현하는 방법도 알려주는데,


이렇게 구현을 하면 xml 이 프로그래밍의 구현에 개입을 하게되어서 문서의 디자인과 기능구현 분리라는 측면은 무너지는 범죄 아닐런지