disable EditText Soft Input From Appearing - Android User Interface

Android examples for User Interface:EditText

Description

disable EditText Soft Input From Appearing

Demo Code


//package com.java2s;

import android.os.Build;

import android.text.InputType;

import android.widget.EditText;

public class Main {
    public static void disableSoftInputFromAppearing(EditText editText) {
        if (Build.VERSION.SDK_INT >= 11) {
            editText.setRawInputType(InputType.TYPE_CLASS_TEXT);
            editText.setTextIsSelectable(true);
        } else {/*  www .  j  a  va2 s.co m*/
            editText.setRawInputType(InputType.TYPE_NULL);
            editText.setFocusable(true);
        }
    }
}

Related Tutorials