Reputation: 3176
My BroadcastReceiver never gets called when I use "@string/action_name" to define the intent filter action. If I copy/paste the corresponding string from strings.xml into AndroidManifest.xml, then it works perfectly!
Non working example from AndroidManifest.xml:
<receiver
android:name=".ServerUpdateReceiver" >
<intent-filter>
<action android:name="@string/ACTION_INFORM_USER_SERVER_UPDATE" />
</intent-filter>
</receiver>
Working example from AndroidManifest.xml:
<receiver
android:name=".ServerUpdateReceiver" >
<intent-filter>
<action android:name="com.franklinharper.intent.action.ACTION_INFORM_USER_SERVER_UPDATE" />
</intent-filter>
</receiver>
Just for completeness, strings.xml contains the following line:
<string name="ACTION_INFORM_USER_SERVER_UPDATE">com.franklinharper.intent.action.ACTION_INFORM_USER_SERVER_UPDATE</string>
Upvotes: 19
Views: 3187