0

I need help, I have been searching for hours a solution to this problem without success... I have an EditText inside a ViewGroup, when I click on this editText the virtual keyboard is shown. The problem is that on Android 4.2+ devices everything works as expected, the edittext is pushed up. On pre 4.2 devices the edittext stays behind the keyboard.

I have tried this on the manifest file but nothing change:

<activity
  ...
  android:windowSoftInputMode="adjustPan"> //or adjustResize
</activity>

Why is this happening and how can I fix it? Thank you!

Istigar
  • 221
  • 1
  • 3
  • 5

1 Answers1

0

To solve this, use this for your editText:

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE|WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
AggieDev
  • 5,015
  • 9
  • 26
  • 48
  • Thanks but is not working, SOFT_INPUT_STATE_VISIBLE makes the keyboard appear automatically and thats not what I want, and the edittext stays behind like always (on pre 4.2 devices) – Istigar Dec 15 '14 at 09:50