Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.widget.EditText;

public class Main {
    public static void setText(EditText editText, String text) {
        editText.setText(text);
        setCursorAtTheEnd(editText);
    }

    public static void setCursorAtTheEnd(EditText editText) {
        try {
            if (editText != null) {
                editText.setSelection(editText.getText().length());
            }
        } catch (Exception ex) {
        }
    }
}