I could set
InputType
<EditText
android:inputType="time"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
digits
colon(:)
InputType
For time
field:
setInputType(InputType.TYPE_CLASS_DATETIME |InputType.TYPE_DATETIME_VARIATION_TIME);
datetime has dot(.), slash(/) which I do not want to show in keyboard
You should try with
setKeyListener(DigitsKeyListener.getInstance("0123456789:"));