Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show soft keyboard when the device is landscape mode

This code seems not to work in Landscape mode:

EditText destinationSearch = (EditText) findViewById(R.id.destinationSearch); 

destinationSearch.requestFocus(); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(destinationSearch, InputMethodManager.SHOW_IMPLICIT);

Is there any solution to show the soft keyboard in Landscape mode ?

like image 947
andreea Avatar asked Jan 21 '11 17:01

andreea


1 Answers

You need to use show forced

InputMethodManager imm;
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,InputMethodManager.HIDE_IMPLICIT_ONLY);
imm.showSoftInput(this.editText,InputMethodManager.SHOW_FORCED);
like image 118
Bakih Avatar answered Oct 02 '22 07:10

Bakih