브로드캐스트 리시버 등록할때 메니패스트파일에있는 <receiver> 내에 있는 <intent-filter>에 액션을 정의하면 정의해놓은 액션에만 리시버가 응답하겠다고 정의하겠다는 거잖아요
<receiver android:name="testReceiver">
<intent-filter>
<action android:name="android.intent.action.ACTION_POWER_CONNECTED"></action>
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED"></action>
<action android:name="android.intent.action.SCREEN_ON"></action>
<action android:name="android.intent.action.SCREEN_OFF"></action>
<action android:name="android.intent.action.HEADSET_PLUG"></action>
<action android:name="android.intent.action.BATTERY_CHANGED"></action>
</intent-filter>
</receiver>
위 소스에서 붉은 색으로 마킹되어 있는 부분은 리시버가 정상적으로 응답을 하는데 나머지 액션들은 리시버가 응답을 못하내요\
그래서 액티비티가 활성화되었을때만 리시버를 동작하게 하는 registerReceiver()를 이용해서 동작시키니 반응을 하더라구요
혹시 브로드캐스트 리시버가 받는 액션들중 매니패스트에만 등록하면 제대로 동작되지 않는 액션들이 있는건가요? 답변 부탁드립니다.
You can not receive this through components declared in manifests, only by explicitly registering for it with
Context.registerReceiver()
. SeeACTION_BATTERY_LOW
,ACTION_BATTERY_OKAY
,ACTION_POWER_CONNECTED
, andACTION_POWER_DISCONNECTED
for distinct battery-related broadcasts that are sent and can be received through manifest receivers.라고 개발자사이트에 적혀있습죠~ ㅎㅎ 위에 열거된 action들 이외에도 많으니 찾아보셔서 쓰셔야 합니다~ manifest에 등록하는것으로 액션을 받을 수 없습니다.