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 setEnd(EditText et) {
        if (!isEmpty(et)) {
            et.setSelection(getString(et).length());
        }
    }

    public static boolean isEmpty(EditText... editTexts) {
        for (EditText editText : editTexts) {
            String content = editText.getText().toString().trim();
            if (content == null || content.length() == 0) {
                return true;
            }
        }
        return false;
    }

    public static String getString(EditText et) {
        return et.getText().toString().trim();
    }
}