-1

How can I set the cursor position to the right of the hint message.

entire code is here

         <android.support.design.widget.TextInputEditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="1dp"
                android:hint="@string/_254"
                android:inputType="phone"/>
Dhanshri
  • 730
  • 6
  • 19
Brian O
  • 77
  • 1
  • 10

2 Answers2

2

This is how I have managed to solve the problem`

**java **

final EditText edit = findViewById(R.id.hint);
edit.requestFocus();
edit.setSelection(edit.length()-0);

`

Brian O
  • 77
  • 1
  • 10
1

The use of hint is to prefeed the EditText and when the user typing the hint would be replace by user's entry

Maybe you would like to use the android:text instead or you can use the setSelection() method for place the cursor at the right position

Vodet
  • 1,235
  • 15
  • 32