CMA
CMA

Reputation: 2818

Keyboard is hidden on orientation change

My keyboard is hidden when the orientation of the android phone changes to landscape. What should I do in order to show my keyboard?

Upvotes: 2

Views: 2566

Answers (4)

Amit Thaper
Amit Thaper

Reputation: 2137

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

put this in onCreate() and onResume() in your class file.

Upvotes: 2

Hussain
Hussain

Reputation: 5562

Try this:

 InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
 imm.showSoftInputFromWindow(enterChat.getWindowToken(), 0);

 getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);

This will make your keyboard always visible. In this the enterchat is editText I have used. You don't need that thing i think.

Upvotes: 0

Nikhil
Nikhil

Reputation: 16196

Hi can you try AndroidManifest.xml

android:windowSoftInputMode="stateAlwaysVisible" put this.

Upvotes: 0

Sujit
Sujit

Reputation: 10632

Add this on your code

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);

Upvotes: 3

Related Questions