Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I was having the same issue, and this thread helped me get TimeZone updates working, however I still wasn't getting notifications for Date/Time changes. I finally found that there's a difference in what you specify in your manifest file and what your broadcast receiver uses when filtering intents. While it <em>IS</em> documented in the Android Intent reference, it is very easy to overlook!</p> <p>In your AndroidManifest.xml file, use the following:</p> <pre><code> &lt;receiver android:name=".MyReceiver"&gt; &lt;intent-filter&gt; &lt;!-- NOTE: action.TIME_SET maps to an Intent.TIME_CHANGED broadcast message --&gt; &lt;action android:name="android.intent.action.TIME_SET" /&gt; &lt;action android:name="android.intent.action.TIMEZONE_CHANGED" /&gt; &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt; &lt;/intent-filter&gt; &lt;/receiver&gt; </code></pre> <p>And in your receiver class:</p> <pre><code>public class MyReceiver extends BroadcastReceiver { private static final String TAG = "MyReceiver"; private static boolean DEBUG = true; @Override public void onReceive(Context context, Intent intent) { final String PROC = "onReceive"; if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) { if (DEBUG) { Log.v(TAG, PROC + ": ACTION_BOOT_COMPLETED received"); } } // NOTE: this was triggered by action.TIME_SET in the manifest file! else if (intent.getAction().equals(Intent.ACTION_TIME_CHANGED)) { if (DEBUG) { Log.v(TAG, PROC + ": ACTION_TIME_CHANGED received"); } } else if (intent.getAction().equals(Intent.ACTION_TIMEZONE_CHANGED)) { if (DEBUG) { Log.v(TAG, PROC + ": ACTION_TIMEZONE_CHANGED received"); } } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload