1

I have four tabs in my home screen and one of them takes user input.On entering data in the input tab the keyboard opens up.This keyboard remains open when i switch to other tab.Any suggestions about what i need to do ?

  • http://stackoverflow.com/questions/10297376/how-do-i-hide-the-soft-keyboard-when-changing-tabs – Kunal Khaire Apr 09 '13 at 10:19
  • [See this - ][1]http://stackoverflow.com/questions/1109022/close-hide-the-android-soft-keyboard?rq=1 [1]: http://stackoverflow.com/questions/1109022/close-hide-the-android-soft-keyboard?rq=1 – Neo Apr 09 '13 at 10:20

2 Answers2

1

The following code is copied from Close/hide the Android Soft Keyboard.

Next time, please, search the forum before posting a question:

tabHost.setOnTabChangedListener(new OnTabChangeListener()
        {
        public void onTabChanged(String tabId)
            {
            InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
            imm.hideSoftInputFromWindow(tabHost.getApplicationWindowToken(), 0);
            }
        }
Community
  • 1
  • 1
cyanide
  • 3,512
  • 3
  • 20
  • 31
0

this may helps you , in your Manifest with Activity declaire like this

<activity android:windowSoftInputMode="adjustResize" />

or

<activity android:windowSoftInputMode="adjustPan" /> for more info 

see Here

or

<activity
        android:name=".Home"
        android:configChanges="keyboardHidden|orientation">
    </activity>
Ankitkumar Makwana
  • 3,664
  • 3
  • 16
  • 44
  • Tried,this but dint worked for me. http://stackoverflow.com/questions/10297376/how-do-i-hide-the-soft-keyboard-when-changing-tabs this is what worked for me. Thanks for your time. – Kunal Khaire Apr 09 '13 at 10:45