set EditText Cursor Position - Android User Interface

Android examples for User Interface:EditText

Description

set EditText Cursor Position

Demo Code


//package com.java2s;

import android.text.Selection;

import android.widget.EditText;

public class Main {

    public static void setEditTextCursorPosition(EditText editText,
            int position) {
        Selection.setSelection(editText.getText(), position);
    }/* w  w w.  j a v  a 2s . c  o m*/
}

Related Tutorials