0

I had a problem with my layout, when the softkeyboard was visible, page scroll did not working.I searched through net and I find out using

android:windowSoftInputMode="adjustResize"

solves the problem, and it did. However it caused some other problems. Now when I choose an edittext to type, the soft input covers the edittext and I can't see what I'm typing.

So I decided to get ride of that and I removed it from my manifest. But it didn't come back to previous state. It still works like the way it worked with adjustResize. (I cleaned and build project several times, I restarted my pc and cellphone couple times, I test it in other cellphones,...). Also, when Soft keyboard is open, and I touch to open the navigation drawer menu, the menu opens under keyboard too!!!

I can't figure out what did happened!

Taher
  • 1,185
  • 3
  • 18
  • 36

1 Answers1

0

You can programatically remove keyboard from screen by toggling it off. Please try below and call it after you are done with your edittext. It will remove keyboard from screen.

InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(
              Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(YOUREDITTEXT.getWindowToken(), 0);

As you stated, that is for closing soft keyboard, also for handling your issue, you need to have a scroll layout as your parent layout, with using

 android:windowSoftInputMode="adjustResize"

like you already did. After applying those, you will have no issue.

denizt
  • 713
  • 5
  • 21
  • Yhansk for answering my question, however this code just make the soft keyboard hidden after typing, my problem is when I touch edittext, the keyboard comes over edittext, it covers edittext. – Taher May 11 '15 at 06:41