There are two edit text ::
Onclick of edittext timepicker
We can do it smriti3 ,Please try my below sample code and let me know if you found any issues,
And Add this sample code in within Activity
Calendar mcurrentDate=Calendar.getInstance();
int mHour=mcurrentDate.get(Calendar.HOUR_OF_DAY);
int mMinute=mcurrentDate.get(Calendar.MINUTE);
EditText mAddTime=(EditText)findViewById(R.id.add_TimePicker);
mAddTime.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
TimePickerDialog mTimePicker=new TimePickerDialog(AddNewMessage.this, new OnTimeSetListener() {
public void onTimeSet(TimePicker timepicker, int selectedhour, int selectedminute) {
// TODO Auto-generated method stub
mAddTime.setText(selectedhour+":"+selectedminute);
}
},mHour, mMinute,true);
mTimePicker.setTitle("Set Time");
mTimePicker.show();
}
});