Java tutorial
//package com.java2s; import android.annotation.SuppressLint; import android.text.InputType; public class Main { @SuppressLint("InlinedApi") public static boolean isPasswordField(int inputType) { int inputClass = inputType & InputType.TYPE_MASK_CLASS; int inputVariation = inputType & InputType.TYPE_MASK_VARIATION; return inputClass == InputType.TYPE_CLASS_TEXT && (inputVariation == InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD || inputVariation == InputType.TYPE_TEXT_VARIATION_PASSWORD || inputVariation == InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD); } }