Soft keyboard covers an EditText in a PopupWindow

There is simpler way. Just provide alternative layout for active keyboard.

  1. Left click on project select: "Android tools/New Resource File..." .
  2. Chose layout, give file name "main" (don't worry about conflicts).
  3. Click "next". Then on list on the left select "keyboard" and move it to right (click "->").
  4. On right side select keyboard state.
  5. Click finish.
  6. Now copy content of your main.xml located in "res/layout" to new file in res/layout-keyssoft".
  7. Correct new layout in such way that keyboard is not in that way. Remember to maintain same "id"s for respective components in those two layouts (that is why copy paste was needed).
  8. Enjoy how it works

Read about configuration changes to understand how it works. Note that EVERY configuration change (orientation change, language change, ...) will cause recreation of Activity (in such case argument of onCreate is not null) so you can provide different layouts for different cases.


For anyone stumbling upon this in the future, I ended up just using a Dialog instead of a PopupWindow, and panning to keep the EditText in view works fine on 2.2 with a Dialog.