date - Android widget can't receive the DATE_CHANGED message -


I am developing a calendar widget, and when I date manually .

What is the problem?

My code is in the manifest:

  & lt; Receiver Android: name = "com.widget.calendar.CalendarWidgetProvider" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.appwidget.action.APPWIDGET_UPDATE" /> & Lt; Action Android: name = "android.intent.action.DATE_CHANGED" /> & Lt; / Intent-Filter & gt; & Lt ;! - This widget specifies provider information - & gt; & Lt; Meta-Data Android: name = "android.appwidget.provider" Android: resource = "@xml / widgetinfo" /> & Lt; / Receiver & gt;   

And I tried to get it this way:

  Override public zero at @Receive (reference CTX, intent to 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 is not printed when I change the system date manually.

Thank you!

Update:

I solved it, this is actually a bug of DATE_CHANGED.

Use this intent:

  & lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.TIME_SET" /> & Lt; / Intent-Filter & gt;   

Get more:

  Override public null at @Receive (reference CTX, Objective of Intent) {Final string action = intent.getAction ( ); If (action.equalsIgnoreCase ("android.intent.action.TIME_SET")) {Log.e (Tag, "Date changed ..... !!!!!!!!!!!!!!!!! !!!!!!!!!!! "); } Super.onReceive (CTX, Intent); }    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -