android set hidden the keyboard on press enter (in a EditText)

前端 未结 5 1158
醉酒成梦
醉酒成梦 2021-01-31 04:20

When my user press Enter on the virtual android \"user validate entry!\" keyboard my keyboard stay visible! (Why?)

Here my Java code...

privat         


        
5条回答
  •  说谎
    说谎 (楼主)
    2021-01-31 04:51

    If you make the text box a single line (I believe the propery is called SingleLine in the layout xml files) it will exit out of the keyboard on enter.

    Here you go: http://developer.android.com/reference/android/R.styleable.html#TextView_singleLine

提交回复
热议问题