Java Code Examples for android.content.Intent.ACTION_TIME_CHANGED

The following are Jave code examples for showing how to use ACTION_TIME_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);
}