editdate.setOnClickListener( new View.`OnClickListener`() {
@Override
public void onClick(View v) {
Calendar mcurrentDate = Calendar.getInstance();
int mYear = mcurrentDate.get(Calendar.YEAR);
int mMonth = mcurrentDate.get(Calendar.MONTH);
int mDay = mcurrentDate.get(Calendar.DAY_OF_MONTH);
DatePickerDialog mDatePicker;
mDatePicker = new DatePickerDialog(CreatNotes.this, new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker datepicker, int selectedyear, int selectedmonth, int selectedday) {
// TODO Auto-generated method stub
/* Your code to get date and time */
//, selectedmonth = selectedmonth + 1;
editdate.setText("" + selectedday + "/" + selectedmonth + "/" + selectedyear);
}
}, mYear, mMonth, mDay);
// mDatePicker.setTitle("Select Date");
mDatePicker.show();
}
} );``
答案 0 :(得分:1)
使用此,
editdate.setFocusable(false);
editdate.setCursorVisible(false);
editdate.setKeyListener(null);
答案 1 :(得分:0)
尝试添加:
android:focusableInTouchMode="false"
给你edittext
xml代码
答案 2 :(得分:0)
将android:focusable="false"
添加到您的EditText
。