After looking up various questions on stack overflow, I have found that many other people had the following problems:
- Background gets resized when soft keyboard opens
- Soft keyboard opens when activity starts
The solution to both of these lies in the ActivityManifest.xml
.
To prevent the background image from being resized when the soft keyboard opens, you can add android:windowSoftInputMode="stateVisible|adjustPan"
to the <activity>
in the manifest.
To prevent the soft keyboard opening when the activity starts, you can add android:windowSoftInputMode="stateHidden"
to the <activity>
in the manifest.
The fact that one solution requires stateHidden
and the other requires stateVisible
means that I cannot use both solutions. I am looking to prevent the soft keyboard from stealing focus on activity start but also prevent the soft keyboard from resizing the background when the user does decide to focus on the EditText
.
Is there a viable solution to both of these issues?