Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to set android:windowSoftInputMode by Fragment?

android:windowSoftInputMode is set normally set on an Activity but I set everything up as one Activity that switches to different Fragments to support tabbing and I need different soft input mode for fragments.

My actual problem is that adjustPan causes text views within webviews to get covered by the keyboard and adjustResize was resizing a view that I was using for calculations and I thought setting different soft input mode for each fragment would be a good workaround.

like image 573
dt0 Avatar asked Jan 30 '14 21:01

dt0


1 Answers

try this each onCreateView of your fragment

getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);

i hope its works for you and reply

like image 185
Lokesh Avatar answered Nov 15 '22 14:11

Lokesh