Android Question B4XComboBox not hiding keyboard when user goes to select item.

simonwilliamson

Member
Licensed User
Is it possible to hide the keyboard when a user clicks a B4XComboBox (i.e. take the focus away from the previous text field)?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Better solution:

B4X:
Private Sub AddTouchEventToSpinner(Spinner As Spinner)
    Dim r As Reflector
    r.Target = Spinner
    r.SetOnTouchListener("Spinner_Touch")
End Sub

Private Sub Spinner_Touch (ViewTag As Object, Action As Int, X As Float, Y As Float, MotionEvent As Object) As Boolean
    If Action = 0 Then
        Dim ime As IME 'ignore
        ime.HideKeyboard
    End If
    Return False
End Sub

Depends on: Reflection and IME
Usage:
B4X:
AddTouchEventToSpinner(B4XComboBox1.cmbBox)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…