Friday, June 15, 2012

Disable Soft KeyPad in Android

Today we will learn another small trick to disable the softkeypad in Android

Sometime you need to disable the Soft Keypad / Virtual Keypad and want to input from either Physical Keypad or Design your own keypad.

Pretty simple and only single line code i have written below

        //disable soft keypad

also i made simple app to achieve this if need then have look on it.

App Name: DisableKeypad
Package Name: com.rdc
Android SDK: Android SDK 2.3.3 / API 10
Default Activity Name: DisableKeypadActivity
so here is the code

package com.rdc;

import android.os.Bundle;
import android.text.InputType;
import android.widget.EditText;

public class DisableKeypadActivity extends Activity {
    private EditText txtName=null;
    public void onCreate(Bundle savedInstanceState) {
        //get the id of edit text 
        txtName =(EditText) findViewById(;
        //disable soft keypad





Tested on Real Androd Device [Sony Ericsson (XPERIA)] the output will be like this..

I'd love to hear your thoughts!

No comments:

Post a Comment