How to move the layout up when the soft keyboard is shown android

I have a login screen with two EditTexts and a login button in my layout. The problem is that, when I start typing, the soft keyboard is shown and covers the login button. How can I push the layout up or above the keyboard when it appears?

I do not want to use a ScrollView, just want to implement it without scrolling down. Please, suggest me some way of doing it. Thanks in advance.


Set windowSoftInputMode property to adjustPan and adjustResize

<activity android:windowSoftInputMode="adjustPan|adjustResize"> </activity>

Try this in the android manifest file corresponding to the activity.

<activity android:windowSoftInputMode="adjustPan"> </activity>

Use this code in onCreate() method:

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

only

android:windowSoftInputMode="adjustResize"

in your activity tag inside Manifest file will do the trick