List of usage examples for android.provider AlarmClock EXTRA_LENGTH
String EXTRA_LENGTH
To view the source code for android.provider AlarmClock EXTRA_LENGTH.
Click Source Link
From source file:com.example.android.wearable.timer.SetTimerActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); int paramLength = getIntent().getIntExtra(AlarmClock.EXTRA_LENGTH, 0); if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "SetTimerActivity:onCreate=" + paramLength); }//from w ww . j av a2 s.c o m if (paramLength > 0 && paramLength <= 86400) { long durationMillis = paramLength * 1000; setupTimer(durationMillis); finish(); return; } Resources res = getResources(); for (int i = 0; i < NUMBER_OF_TIMES; i++) { mTimeOptions[i] = new ListViewItem(res.getQuantityString(R.plurals.timer_minutes, i + 1, i + 1), (i + 1) * 60 * 1000); } setContentView(R.layout.timer_set_timer); // Initialize a simple list of countdown time options. mListView = (ListView) findViewById(R.id.times_list_view); ArrayAdapter<ListViewItem> arrayAdapter = new ArrayAdapter<ListViewItem>(this, android.R.layout.simple_list_item_1, mTimeOptions); mListView.setAdapter(arrayAdapter); mListView.setOnItemClickListener(this); mGoogleApiClient = new GoogleApiClient.Builder(this).addApi(Wearable.API).addConnectionCallbacks(this) .addOnConnectionFailedListener(this).build(); }