Java tutorial
//package com.java2s; import android.widget.EditText; public class Main { public static boolean checkNumeric(EditText editText) { String mobilePattern = "[0-9]"; return (!editText.getText().toString().matches(mobilePattern)) ? true : false; } }