How to position the cursor in AutoCompleteTextView
Asked Answered
G

1

6

In My app I'm using AutoCompleteTextView. When the user select a result item, one of the option is inserting the selected text into the AutoCompleteTextView. After inserting text, the cursor returns to the initial position. How can i position it in the end of the inserted text? Thanks, Eyal

Geehan answered 21/5, 2014 at 7:32 Comment(2)
please put related code here.Resurrection
autoCompleteTextView.setText(title);Geehan
C
12

try setSelection(int index), it looks like what you are looking for

http://developer.android.com/reference/android/widget/EditText.html

I can do better with your code. You probalby need to choose the good listener to use it

Campuzano answered 21/5, 2014 at 7:36 Comment(1)
mEditTextLocation.setSelection(mEditTextLocation.getText().toString().trim().length());// End point CursorSalutation

© 2022 - 2024 — McMap. All rights reserved.