I would like to reposition layout when keyboard appears, for example when editing a text field, in order to get visibility on focused field. I tried windowSoftInputMode but I cannot get any difference. How to reach it? Thank you.
<activity
android:name="com.xxxx.projecte1.TabBar_Activity"
android:theme="@android:style/Theme.NoTitleBar"
android:configChanges="keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize"
/>
Posted on October 25, 2010 by Lars Vogel. Android has the so-called Input Method Framework to support different input methods, e.g. keyboard, soft-keyboard, handwriting etc. If the soft-keyboard is used it is diplayed at the bottom of the screen once the user select an text view to edit it.
What fixed it in my case was just putting
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
into my activity's onCreate
method.
Without any xml changes whatsoever, since those did not work for me whatsoever, but this worked right away like a charm. Although an xml solution seems nicer to me, even the same parameter did not work.
Sharing it since I did not find a quick and easy fix myself online.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With