Activity does not change when keyboard is displayed

I have a simple activity that displays a large multiline EditText

and some other controls below it. I want the activity to be resizable so the buttons are not hidden by the keyboard when the user enters text EditText

.

I've tried all sorts of sketchy and non-sketchy solutions I've found on the internet - nothing works.

Here's what I've tried so far:

  • Place android:windowSoftInputMode="adjustResize"

    in manifest.
  • Insert android:fitsSystemWindows="true"

    into the root of the layout.
  • Using RelativeLayout

    vs. LinearLayout

    as root.
  • Removed all topics from activity.
  • Created a custom theme and put it into it <item name="android:windowFullscreen">false</item>

    .
  • Tried the suggested solution here with my way of doing things inside ScrollView

    .

Anything left to try?

+3


source to share


2 answers


Put the following lines in onCreate()

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

      



Then your activity will automatically push up / down when the keyboard is showing / hiding on the screen.

Setting up with a manifest file didn't work for me.

+3


source


Place your shape inside ScrollView

. So when you drop down on the keyboard, your components can scroll.



-1


source







All Articles