8

I have a popup window with an adview appearing at the bottom or my screen. I am doing it this way so the user can click an x to close the ad.

When the virtual keyboard comes up when the popUpWindow is active, the ad is still visible. How can I make the keyboard take precidence over the popUpWindow or tell the popUpWindow to not be on the very top?

Jeremey
  • 1,456
  • 3
  • 13
  • 19

3 Answers3

9

You have to set setInputMethodMode(INPUT_METHOD_NEEDED) on the popup window before calling it, then the popup will show behind the keyboard. If you have also defined setHeight(WindowManager.LayoutParams.WRAP_CONTENT) on the popup, then it will even resize when the keyboard is hidden or shown again.

ywwynm
  • 11,573
  • 7
  • 37
  • 53
androidCoder
  • 202
  • 3
  • 5
2

Try using android:windowSoftInputMode="adjustPan" in your activity tag in the Manifest file

Lalit Poptani
  • 67,150
  • 23
  • 161
  • 242
  • This didn't work. I should add that the popup window is called from a tabActivity, and the editText view is in one of the child tab activities. – Jeremey Dec 13 '11 at 04:56
  • Yes you must have added that also, try adding this in the TabActivity tag in the manifest file. – Lalit Poptani Dec 13 '11 at 05:01
  • Still doesn't work. I don't believe a popupwindow can be pushed or resized by softinput. I was able to resolve the issue by closing the popup window when the tab that has soft input was selected. However, this is not desirable. – Jeremey Dec 19 '11 at 04:06
0

add to your popWindow Hieght WRAP_CONTENT

popWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
Amirouche Zeggagh
  • 3,428
  • 1
  • 25
  • 22