Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.lang.reflect.Method;

import android.app.Activity;

import android.os.Build;

import android.widget.EditText;

public class Main {
    public static void removeSysKey(Activity context, EditText paramEditText) {
        if (Build.VERSION.SDK_INT <= 10) {
            paramEditText.setInputType(0);
            return;
        }
        context.getWindow().setSoftInputMode(3);
        try {
            Class[] arrayOfClass = new Class[1];
            arrayOfClass[0] = Boolean.TYPE;
            Method localMethod = EditText.class.getMethod("setShowSoftInputOnFocus", arrayOfClass);
            localMethod.setAccessible(true);
            Object[] arrayOfObject = new Object[1];
            arrayOfObject[0] = Boolean.valueOf(false);
            localMethod.invoke(paramEditText, arrayOfObject);
            return;
        } catch (Exception localException) {
            localException.printStackTrace();
        }
    }
}