I got this code that worked to some extent. But the updateLabel
method I can not do because of the problem:
Ineedtopickthedateselectedfromthecalendar.I'musingaformwherebyclickingeditText,thecalendaropens.
finalDatePickerDialog.OnDateSetListenerdate=newDatePickerDialog.OnDateSetListener(){@OverridepublicvoidonDateSet(DatePickerview,intyear,intmonthOfYear,intdayOfMonth){//TODOAuto-generatedmethodstubmyCalendar.set(Calendar.YEAR,year);myCalendar.set(Calendar.MONTH,monthOfYear);myCalendar.set(Calendar.DAY_OF_MONTH,dayOfMonth);updateLabel(myCalendar);}};editText.setOnClickListener(newView.OnClickListener(){@OverridepublicvoidonClick(Viewv){//TODOAuto-generatedmethodstubnewDatePickerDialog(AgendamentoActivity.this,date,myCalendar.get(Calendar.YEAR),myCalendar.get(Calendar.MONTH),myCalendar.get(Calendar.DAY_OF_MONTH)).show();//Toast.makeText(getBaseContext(),"8:00 - 9:00", Toast.LENGTH_LONG).show();
}
});
private void updateLabel(Calendar) {
SimpleDateFormat dateFormat = new SimpleDateFormat("EEE MMM dd hh:mm:ss 'GMT'Z yyyy");
System.out.println(dateFormat.format(myCalendar.getTime()));
//editText.setText(sdf.format(myCalendar.getTime()));
}