java - programmatically control cursor and text in EditText -


i have edittext box in want control cursor , modify text programmatically

  • i have 12 button keypad made using 12 buttons in gridview. each button press have specific text inserted in edittext box @ cursor position. need cursor position can insert custom text in edittext view
  • i have 2 buttons moving cursor position left/right 1 character. alternatively cursor can set touching edittext view (as edittext supposed behave)
  • also want current position of cursor in edittext whenever cursor position changes (i think have implement kind of interface dont know how)

what have tried far

  • i storing key presses in arraylist<string>
  • i setting edittext.settext(string) everytime key pressed
  • can editable text through gettext() settext() accepts strings.

hence confused. should fulfill requirements.
ps: android beginner, , making 2nd app (which scientific calculator if helps)
if volunteers review code, i'll obliged him

to set number in edittext use wrapper class set on edittext using tostring().

for set position can use edittext.setselection(position);


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -