EditText.selectAll and android 4 ?

jnbarban

Member
Licensed User
Longtime User
hi , i have a problem with "EditeTexte.SelectAll" function.

in my application, i use this to select all Text when user click on him :

Code: Copy
Sub txb_NombrePieces_FocusChanged (HasFocus As Boolean)
   txb_NombrePieces.SelectAll
End Sub

and

Code: Copy
Sub txb_NombrePieces_Click
   txb_NombrePieces.SelectAll
End Sub

work fine on Galaxy tab 1 ( Android 3)
on Galaxy Tab 2 ( Android 4 ), the texte is never selected. the cursor go on first position and this is all.
where is the probleme ?
 
If you only want to have the text selected when you actually focus the edittext and not when it loses the focus, you should do:
Code: Copy
Sub txb_NombrePieces_FocusChanged (HasFocus As Boolean)
    If HasFocus = True Then
        txb_NombrePieces.SelectAll
    End If
End Sub
I don't see why it wouldn't work on Android 4 though.
 
Upvote 0
I'm trying your solution but the probleme are the same. when i clic on edittextbox, i see the curseur go at last position and just after, go at first.

but nothing was selected ??
 
Upvote 0
works once every two ?

clic on txb1 --> nothing selected in txb1
clic on txb2 --> nothing selected in txb2
clic on txb1 --> txb1 selected
clic on txb2 --> txb2 selected
clic on txb1 --> nothing selected in txb1
clic on txb2 --> nothing selected in txb2
clic on txb1 --> txb1 selected
clic on txb2 --> txb2 selected
clic on txb1 --> nothing selected in txb1
clic on txb2 --> nothing selected in txb2
...

strange ?
 
Upvote 0
Good Erel !!! Thanks

i have completed with :

Code: Copy
Sub txb_NombrePieces_TextChanged (Old As String, New As String)
   tmr.Enabled = False
End Sub

else the text is ever selected every X millisecond...
 
Upvote 0
I would follow SCIS suggestion, and at the same time I would remove the editText_click handle.
 
Upvote 0
Back
Top