I have a
layout:
This only worked for me:
android:windowSoftInputMode="adjustPan"
Also if you want to do that programmatically just add the below line to the onCreate of the activity.
getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE |
WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE );
Ok, I have searched several hours now to find the problem, and I found it.
None of the changes like fillViewport="true"
or android:windowSoftInputMode="adjustResize"
helped me.
I use Android 4.4 and this is the big mistake:
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
Somehow, the Fullscreen themes prevent the ScrollViews from scrolling when the SoftKeyboard is visible.
At the moment, I ended up using this instead:
android:theme="@android:style/Theme.Black.NoTitleBar
I don't know how to get rid of the top system bar with time and battery display, but at least I got the problem.
Hope this helps others who have the same problem.
EDIT: I got a little workaround for my case, so I posted it here:
I am not sure if this will work for you, but it will definitely help you in understanding, and clear some things up.
EDIT2: Here is another good topic that will help you to go in the right direction or even solve your problem.
put this inside your Manifest like this in No fullscreen Mode
android:windowSoftInputMode="stateVisible|adjustPan"
in your manifest
<activity
android:windowSoftInputMode="stateVisible|adjustPan"
android:name="com.example.patronusgps.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
well the simplest answer i tried is just remove your code which makes the activity go full screen .I had a code like this which was responsible for making my activity go fullscreen :
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}
i just removed my code and it works completely fine although if you want to achieve this with your fullscreen on then you'll have to try some other methods
In your Manifest
define windowSoftInputMode
property:
<activity android:name=".MyActivity"
android:windowSoftInputMode="adjustNothing">