I have been having problems changing all refernce to this custom intent. Aka I change the name and it no longer registers. However, more concerningly, it seems I cant get any broadcasted intents! (Except APPWIDGET_UPDATE).
<receiver android:name=".ExampleAppWidgetProvider"
android:label="@string/widget1name">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<!-- <action android:name="com.eightbitcloud.example.widget.8BITCLOCK_WIDGET_UPDATE" /> -->
<action android:name="android.intent.action.MEDIA_REMOVED" />
<action android:name="android.intent.action.MEDIA_UNMOUNTED" />
<action android:name="android.intent.action.MEDIA_MOUNTED" />
<action android:name="android.intent.action.SCREEN_ON" />
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="@xml/widget1_info" />
</receiver>
With code:
@Override
public void onReceive(Context context, Intent intent) {
Log.d(LOG_TAG, "Received intent " + intent.getAction());
The only one that fires is Appwidget_update.
Why?
This was to do with the my
onEnabled()event, creating an alarmManager that sends the given intent again and again.By changing what I was recieving, I obviously filter out the old one.
However what I failed to see, was that Eclipse was replacing my widget when I ran new code, but it never re-fires onEnabled again.
So the old intent was still firing, and being filtered, as opposed to my new named intent.
Restarting the phone, and/or removing the widgets and replacing them should do the trick (So
OnEnabled()is fired again)