Android Question Coordinates x,y of a cursor IN A VIEW

Similar threads

B4A Question Classes are soon coming...
B4A Tutorial SQL tutorial
B4A Question MSSQL-JDBC Minimalistic Example
B4A Code Snippet EditText Utils
Other B4A v9.90 has been released


Licensed User

I need to obtain the x,y of the focus in a view.

For example, in a EditText, if you write a word like HELP and you put the cursor in the midle, like HE_LP, I need to obtain the coordinates x,y of the cursor at this moment (The coordinates x,y at position _).

I know that its posible obtain the position in a EditText (character 1,2,3,4,...) but I need the coordinates x,y.

Is it posible?

Thanks a lot.


Licensed User
I think you can simply use a touch gesture to get the cooridantes when clicking on the textview
Yes, but when you write in the EditText, the cursor changes the position and the coordinates change.

I need to obtain the coordinates of the typical verticar bar (the indicator that you are typing in that position).

I have an object like an EditText, but its not an EditText.

narek adonts

Well-Known Member
Licensed User


Licensed User
If you are not touching the editbox the cursor is automaticaly at the end. So editbox.left + editbox.text.measuretextwidth.
When the user change the cursor manualy the x will change to the touch gesture x.
I dont know if I explained correctely.

Yes, but I think that you dont understand me.

The object is EmojiEditText and it has not all the methods of EditText. @DonManfred wrapped the library, but for any reason, the inheritance in the library is incomplete.

I want to catch the position of the cursor and simulate a click when I insert an new icon.

This is the thread: