set Text With Selection to EditText - Android User Interface

Android examples for User Interface:EditText

Description

set Text With Selection to EditText

Demo Code


//package com.java2s;

import android.widget.EditText;

public class Main {
    public static void setTextWithSelection(EditText editText, String str) {
        editText.setText(str);//  w  ww . j a  v a2  s. c o m
        editText.setSelection(str.length());
    }
}

Related Tutorials