Example usage for android.widget TimePicker getId

List of usage examples for android.widget TimePicker getId

Introduction

In this page you can find the example usage for android.widget TimePicker getId.

Prototype

@IdRes
@ViewDebug.CapturedViewProperty
public int getId() 

Source Link

Document

Returns this view's identifier.

Usage

From source file:com.atlas.mars.weatherradar.ActivitySetting.java

@Override
public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {

    switch (view.getId()) {
    case R.id.timePickerFrom:

        if (isInitTimeFrom) {
            textViewFrom.setText("" + hourOfDay + ":" + getMinutes(minute));
            fromMin = minute;/* w  w w .  j a  va  2  s. c  o  m*/
            fromHour = hourOfDay;
        }
        isInitTimeFrom = true;

        break;
    case R.id.timePickerTo:

        if (isInitTimeTo) {
            textViewTo.setText("" + hourOfDay + ":" + getMinutes(minute));
            toMin = minute;
            toHour = hourOfDay;
        }
        isInitTimeTo = true;

        break;
    }

    Log.d(TAG, "" + hourOfDay + ":" + minute);
}