Android Question Event "onSelectionChanged" when cursor change in editext

magicmars

Member
Licensed User
Hi,
I need to do something when the user change the cursor position in an editText.
There is natively no event to handle the cursor changing position in an Edit text (it just handle the text and focus changing).

As i can see , it's possible to create such a listener in java with class override :
Android EditText listener for cursor position change

Is it possible to do such a "onSelectionChanged" event in B4X for the editext ?
Thank you for reply
 

magicmars

Member
Licensed User
I found a workaround by adding a timer, that will check the SelectionStart every 400ms.

B4X:
Sub Timer1_Tick
    If edttxtBot.SelectionStart <> lastCursorPosition Then
        Log ("cursor change")
        lastCursorPosition = edttxtBot.SelectionStart
    End If
End Sub
 
Upvote 0
Top