I am developing a calendar widget and I cannot receive the DATE_CHANGED message when I changed the date of MANUALLY .
What is the problem?
My code in the manifest:
<receiver android:name="com.widget.calendar.CalendarWidgetProvider">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="android.intent.action.DATE_CHANGED"/>
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="@xml/widgetinfo" />
</receiver>
And I tried to get it like this:
@Override
public void onReceive(Context ctx, Intent intent) {
final String action = intent.getAction();
if (action.equalsIgnoreCase("android.intent.action.DATE_CHANGED")) {
Log.e(TAG, "Date changed.....!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
}
super.onReceive(ctx, intent);
}
But the log does not print when I manually change the system date.
Thank!
UPDATE:
I solved this with Intent.ACTION_TIME_CHANGED . This is really a DATE_CHANGED error.
source
share