You can use this code to get the selection end property with the reflection library:
B4X:Sub GetSelectionEnd(txt As EditText) As Int Dim r As Reflector r.Target = txt Return r.RunMethod("getSelectionEnd") End Sub
Sub Globals
Dim et As EditText
End Sub
Sub Activity_Create(FirstTime As Boolean)
et.Initialize("et")
Activity.AddView(et, 0, 0, 200dip, 100dip)
End Sub
Sub et_TextChanged (Old As String, New As String)
Log(GetSelectionEnd(et))
End Sub
Sub GetSelectionEnd(txt As EditText) As Int
Dim r As Reflector
r.Target = txt
Return r.RunMethod("getSelectionEnd")
End Sub
Sub Activity_Click
Log(GetSelectionEnd(et))
End Sub
I tried it with this code and it works correctly:
B4X:Sub Globals Dim et As EditText End Sub Sub Activity_Create(FirstTime As Boolean) et.Initialize("et") Activity.AddView(et, 0, 0, 200dip, 100dip) End Sub Sub et_TextChanged (Old As String, New As String) Log(GetSelectionEnd(et)) End Sub Sub GetSelectionEnd(txt As EditText) As Int Dim r As Reflector r.Target = txt Return r.RunMethod("getSelectionEnd") End Sub Sub Activity_Click Log(GetSelectionEnd(et)) End Sub