Java tutorial
//package com.java2s; import android.widget.EditText; public class Main { public static boolean isValidAadharNumber(EditText aadhar) { boolean flag = false; if (aadhar != null && aadhar.getText().toString().length() == 12) { flag = true; } else { flag = false; } return flag; } }