There is a field with a date, when you click a calendar pops up, and then also a standard keyboard. How to register, what would the keyboard be called to this EditText field?

1 answer 1

Should help

android:focusableInTouchMode="false" android:focusable="false" android:editable="false" 

You can programmatically hide the keyboard

 getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); 

In general, this is not the right approach, you need to make a button or just arrange the Layout normally as a button and add a calendar icon to understand, no need to mislead users when the user sees the input field and pokes it, then it expects something different from you. The input field and is intended to enter from the keyboard, why use it if you do not need it?

  • Everything is normal there for understanding, if you click on the field with the hint "select a date", then it is clear that you need to choose there and not enter and the calendar pops up. - Magatron3000
  • @Magatron3000, what it seems to you that it should be, then, this is bad, what is written there means nothing, this type of field is not suitable for this. Why do you use it if you then remove its main purpose? For your case, there is an element TextView that just exists in order to display information in it, ask it any styles and everything is OK - Abramov Alexey
  • I understand that you did not understand the essence of the issue. In this field, the user will enter a date, when taping on this field, a calendar appears in which the date is selected. I do not need a keyboard, because the calendar pops up. It's simple - there is a calendar - no need for a keyboard - Magatron3000
  • @ Magatron3000 I figured out precisely that in the question you contradict yourself, write what you don’t need to enter and now write that the user enters the date, he doesn’t enter it, he chooses from the calendar, it isn’t input, so I wrote everything correctly . You do not need an input field, since the user does not enter this field from the keyboard, but selects from the calendar - Alexey Abramov
  • Let's, everyone will remain in his opinion, your way helped! Thank! - Magatron3000