android - how to hide virtual keyboard on edittext click -
i have activity in have edittext. on click on edittext want open timepicker dialog. had written code , working. problem when start activity , click on edittext first time-the virtual keyboard opens subsequent click on edittext timepickerdialog opens. not want virtual keyboard open first time.i want timepicker dialog open every time. please help
here code timepickerdialog open on edittext click
timetext=(edittext)findviewbyid(r.id.edittext2);
timetext.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { // todo auto-generated method stub calendar mcurrenttime = calendar.getinstance(); int hour = mcurrenttime.get(calendar.hour_of_day); int minute = mcurrenttime.get(calendar.minute); timepickerdialog mtimepicker; mtimepicker = new timepickerdialog(reminddetail.this, new timepickerdialog.ontimesetlistener() { @override public void ontimeset(timepicker timepicker, int selectedhour, int selectedminute) { timetext.settext( selectedhour + ":" + selectedminute); calender[3]=selectedhour; calender[4]=selectedminute; } }, hour, minute, false);//yes 24 hour time mtimepicker.settitle("select time"); mtimepicker.show(); } });
set property in edit text
android:focusable="false"
Comments
Post a Comment