How to get cursor position (x,y) in EditText android -


how cursor position x,y in edittext in android? (where x line# , y column#)

int pos = edittext.getselectionstart(); layout layout = edittext.getlayout(); int line = layout.getlineforoffset(pos); int baseline = layout.getlinebaseline(line); int ascent = layout.getlineascent(line); float x = layout.getprimaryhorizontal(pos); float y = baseline + ascent; 

and there x, y positions in pixels of cursor.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -