0

I'm making an app for three different devices, Honeywell EDA50, EDA50K and EDA60k, the last two has hardware keyboard while i've started to develop the app for EDA50 so i have lot of edittexts that show the keyboard on focus but now i would be able by checking the device name with the following code:

   public static String getDeviceName() {
        String manufacturer = Build.MANUFACTURER;
        String model = Build.MODEL;
        if (model.startsWith(manufacturer)) {
            return capitalize(model);
        }
        return capitalize(manufacturer) + " " + model;
    }

i would be able to disable the virtualkeyboard for entire app if the device is EDA50K or EDA60K.

I've yet tryed to follow this answer but nothing there are times when anyway the keyboard popup.

Is there any possibility to disable virtual keyboard?

NiceToMytyuk
  • 2,262
  • 17
  • 47

1 Answers1

0

you can try this:

InputMethodManager imm = (InputMethodManager) getSystemService(Activity.INPUT_METHOD_SERVICE);
View view = activity.getCurrentFocus();

if (view == null) {
    view = new View(activity);
}

imm.hideSoftInputFromWindow(view.getWindowToken(), 0);

read full answer: Close/hide the Android Soft Keyboard

Mehrdad
  • 887
  • 7
  • 13
  • that's not working, like in my mainactivity i have a button that open an alertDialog and when i'm trying to use your method that open the vkeyboard anyway – NiceToMytyuk Oct 09 '18 at 13:19