Java Code Examples for android.content.Intent.ACTION_TIMEZONE_CHANGED

The following are Jave code examples for showing how to use ACTION_TIMEZONE_CHANGED of the android.content.Intent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: sample-bluetooth-le-gattserver   File: GattServerActivity.java   View Source Code Vote up 8 votes
@Override
public void onReceive(Context context, Intent intent) {
    byte adjustReason;
    switch (intent.getAction()) {
        case Intent.ACTION_TIME_CHANGED:
            adjustReason = TimeProfile.ADJUST_MANUAL;
            break;
        case Intent.ACTION_TIMEZONE_CHANGED:
            adjustReason = TimeProfile.ADJUST_TIMEZONE;
            break;
        default:
        case Intent.ACTION_TIME_TICK:
            adjustReason = TimeProfile.ADJUST_NONE;
            break;
    }
    long now = System.currentTimeMillis();
    notifyRegisteredDevices(now, adjustReason);
    updateLocalUi(now);
}
 
Example 2
Project: ubiquitous   File: MyWatchFace.java   View Source Code Vote up 6 votes
private void registerReceiver() {
    if (mRegisteredTimeZoneReceiver) {
        return;
    }
    mRegisteredTimeZoneReceiver = true;
    IntentFilter filter = new IntentFilter(Intent.ACTION_TIMEZONE_CHANGED);
    MyWatchFace.this.registerReceiver(mTimeZoneReceiver, filter);
}
 
Example 3
Project: IO_Classic_WatchFace   File: IOClassicWatchFaceService.java   View Source Code Vote up 6 votes
/**
 * Register a receiver for handling timezone changes
 */
private void registerReceiver() {
    if (mRegisteredTimeZoneReceiver) {
        return;
    }
    mRegisteredTimeZoneReceiver = true;
    IntentFilter filter = new IntentFilter(Intent.ACTION_TIMEZONE_CHANGED);
    IOClassicWatchFaceService.this.registerReceiver(mTimeZoneReceiver, filter);
}
 
Example 4
Project: Android_Sunshine_Watch   File: MyWatchFace.java   View Source Code Vote up 6 votes
private void registerReceiver() {
    if (mRegisteredTimeZoneReceiver) {
        return;
    }
    mRegisteredTimeZoneReceiver = true;
    IntentFilter filter = new IntentFilter(Intent.ACTION_TIMEZONE_CHANGED);
    MyWatchFace.this.registerReceiver(mTimeZoneReceiver, filter);
}
 
Example 5
Project: Android-Wear-Projects   File: PacktWatchFace.java   View Source Code Vote up 6 votes
private void registerReceiver() {
    if (mRegisteredTimeZoneReceiver) {
        return;
    }
    mRegisteredTimeZoneReceiver = true;
    IntentFilter filter = new IntentFilter(Intent.ACTION_TIMEZONE_CHANGED);
    PacktWatchFace.this.registerReceiver(mTimeZoneReceiver, filter);
}
 
Example 6
Project: GoUbiquitous   File: DigitalWatchFaceService.java   View Source Code Vote up 6 votes
private void registerReceiver() {
    if (mRegisteredTimeZoneReceiver) {
        return;
    }
    mRegisteredTimeZoneReceiver = true;
    IntentFilter filter = new IntentFilter(Intent.ACTION_TIMEZONE_CHANGED);
    DigitalWatchFaceService.this.registerReceiver(mTimeZoneReceiver, filter);
}