Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Listen when <em>DatePickerDialog</em> closes with <a href="http://developer.android.com/reference/android/app/DatePickerDialog.OnDateSetListener.html" rel="nofollow noreferrer">DatePickerDialog.OnDateSetListener</a>. When onDateSet(...) is called show the next dialog (TimePickerDialog).</p> <p>Edit: I've pasted code which you asked</p> <pre><code>public class YourActivity extends Activity { private final Calendar selectedDate = Calendar.getInstance(); final DatePickerDialog.OnDateSetListener dateListener = new DatePickerDialog.OnDateSetListener() { public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { selectedDate.set(Calendar.YEAR, year); selectedDate.set(Calendar.MONTH, monthOfYear); selectedDate.set(Calendar.DAY_OF_MONTH, dayOfMonth); new TimePickerDialog(YourActivity.this, timeListener, 0, 0, true).show(); } }; final TimePickerDialog.OnTimeSetListener timeListener = new TimePickerDialog.OnTimeSetListener() { public void onTimeSet(TimePicker view, int hourOfDay, int minute) { selectedDate.set(Calendar.HOUR_OF_DAY, hourOfDay); selectedDate.set(Calendar.MINUTE, minute); // push flow to the next step } }; public void startTimeWizard() { final Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(System.currentTimeMillis()); new DatePickerDialog(this, dateListener, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH)).show(); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); startTimeWizard(); } </code></pre> <p>}</p>
    singulars
    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. 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.
 

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