I am trying to have the contained text selected when an EditExt has focus. I have searched the forum and have found recommendations on how to do this. The problem I am having is that in the three test examples below, each will perform the SelectAll function I need in Android V2 (Froyo), but will not do so in Android V4 (ICS). I only have the two devices for testing.
I have run out of ideas as to how this might be done. If anyone has had success in doing this across the various versions of Android, I would greatly appreciate their help in resolving my dilemma.
Best regards :sign0085:
I have run out of ideas as to how this might be done. If anyone has had success in doing this across the various versions of Android, I would greatly appreciate their help in resolving my dilemma.
Best regards :sign0085:
B4X:
' test example one
Sub EditOne_FocusChanged(HasFocus As Boolean)
If HasFocus = True Then
EditOne.SelectAll
End If
End Sub
' *********************************************
' test example two
Sub EditOne_FocusChanged(HasFocus As Boolean)
If HasFocus = True Then
EditOne_Click
End If
End Sub
Sub EditOne_Click 'if in focus
EditOne.SelectAll
End Sub
' *********************************************
' test example three
Sub EditOne_FocusChanged(HasFocus As Boolean)
If HasFocus = True Then
EditOne_Click
End If
End Sub
Sub EditOne_Click 'if in focus
CallSubDelayed(Me, "EditOne_SelectText")
End Sub
Sub EditOne_SelectText
EditOne.SelectAll
End Sub