Guest User

Untitled

a guest
Mar 22nd, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. @Override
  2. public void onConfigurationChanged(Configuration newConfig) {
  3. super.onConfigurationChanged(newConfig);
  4. if(newConfig.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO) {
  5.  
  6. ((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE))
  7. .showInputMethodPicker();
  8. Toast.makeText(this, "Barcode Scanner detected. Please turn OFF Hardware/Physical keyboard to enable softkeyboard to function.", Toast.LENGTH_LONG).show();
  9. }
  10. }
  11.  
  12. InputMethodManager imm = (InputMethodManager)getContext().getSystemService(
  13. Context.INPUT_METHOD_SERVICE);
  14. imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
  15.  
  16. ((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
  17.  
  18. ((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(_pay_box_helper.getWindowToken(), 0);
Add Comment
Please, Sign In to add comment