SoftKeyboard problem with Tabhost on bottom of screen

Many people (including myself) have encountered the problem of having an activity with a Tabhost aligned at the bottom of screen instead of its top.

What happens when you have an EditText or any other input method!
A soft keyboard will appear and push your TabHost above itself.

What's the solution for this? Turns out to be simple!


The cause of this problem is the android:windowSoftInputMethod property of your activity's tag in the manifest file.

To solve it use android:windowSoftInputMode="adjustPan|adjustResize".
Now your tabs will not float above the keyboard when an input starts.

This is really simple and does not need any further explanation. Whenever you decide to use a Tabbed Activity and you place your tabs on the bottom of the screen, use this code to disable the floating behavior.
Ba bye

12 comments:

  1. Thanks, you really helped me out a lot with this.

    ReplyDelete
  2. This is bot always working.. and least not for me!

    ReplyDelete
  3. It is!
    If using an ActivityGroup put android:windowSoftInputMode="adjustPan|adjustResize" in your main activity.

    ReplyDelete
  4. Thank you, really helped me out a lot with this.

    ReplyDelete
  5. This solution is not working, will you please give me some another solution.

    ReplyDelete
  6. does this work on a full screen app?

    ReplyDelete
  7. Thank you this solution really helps, and thanks too for the Anonymous comment who said put this in main activity.

    ReplyDelete
  8. As leaders in the field, we specialise in close protection in London.private security But what is a close protection officer and how is one different from a bodyguard?

    ReplyDelete
  9. After reading your whole article, I was very impressed. This is one of the most useful blogs i've ever seen. Thanks for posting, I look forward to learning more.
    Please see the profile to learn more about Click Test. Please see the profile for more information. Here is my profile, where you can see how to set up a mouse click on Windows.

    ReplyDelete
  10. สล็อต pg ทาง เข้า slot ทาง เข้า เว็บแตกง่าย สมัครเล่นวันนี้แจกฟรี ยินดีต้อนรับทุนท่านไปสู่จักรวาลที่สุด PG SLOT แสนจะท้าทายที่พร้อมจะพาคุณไปเปิดประตูสู่ความร่ำรวยอย่างมากมาย

    ReplyDelete