move Select To EditText End - Android User Interface

Android examples for User Interface:EditText

Description

move Select To EditText End

Demo Code


//package com.java2s;

import android.widget.EditText;

public class Main {
    public static void moveToEnd(EditText edit) {
        if (edit.getText() == null)
            return;
        edit.setSelection(edit.getText().toString().length());
    }/* w  w w .  jav  a2s  .  c  o m*/

    public static String getText(EditText edit) {
        if (edit.getText() == null)
            return "";
        return edit.getText().toString();
    }
}

Related Tutorials