I developed a similar screen once. The layout can be what you imagine. follows the low the methods I did to call the android calendar and capture the date selected by the user in an Edit.
edt_data = (EditText)findViewById(R.id.edt_data);
bCalendario= (Button)findViewById(R.id.b_calendario);
bCalendario.setOnClickListener(new View.OnClickListener() {
@SuppressWarnings("deprecation")
public void onClick(View v) {
showDialog(DATE_DIALOG_ID); //chamar o calendario
}
});
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case DATE_DIALOG_ID: return new DatePickerDialog(this, mDateSetListener,mYear, mMonth-1, mDay);
}
return null;
}
private DatePickerDialog.OnDateSetListener mDateSetListener = new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
mYear = year;
mMonth = monthOfYear;
mDay = dayOfMonth;
updateDisplay();
}
};
private void updateDisplay() {
edt_data.setText(new StringBuilder()
// Month is 0 based so add 1
.append(mDay).append("/")
.append(mMonth + 1).append("/")
.append(mYear).append(" "));
}
Welcome, I recommend making a [tour], and edit your question not to be closed as wide as too, good luck.
– MagicHat
Jorge around here likes you to post what exactly you’ve done and specifically show your problem. A broad question like this is not very well accepted, it doesn’t make a good impression. In fact a broad question like this google answers without problems: https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=Calendar+android+example&*
– Reginaldo Rigo
Thank you so much for the information... it’s the fault of inexperience I’m still adapting the questions ...
– Jorge Avila