SoftKeyboard in Dialog Activity pans the activity behind - android

Just as the title says, from one activity I start a dialog activity that contains an editText. When I click it and the softKeyboard comes up, it pans the DialogActivity but it also affects the activity behind.
This is the manifest entry for the parent activity
<activity
android:name=".BasketStep2Activity"
android:parentActivityName=".home.Start"
android:windowSoftInputMode="stateAlwaysHidden|adjustPan" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".home.Start" />
</activity>
and this is the manifest entry for the dialog activity
<activity
android:name=".SelectRelais"
android:configChanges="keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustPan|stateHidden"
android:theme="#style/AppDialog" >
</activity>
The parent activity pans to the bottom as if there was an editText with focus there. If i use "adjustResize", everything is obviously messed up. Is there a way to prevent any changes to the background activity?

use adjustNothing instead of adjustPan in parent activity

Related

Android - Button on bottom of the screen and Keyboard starting on top of it

Is it possible to have a button on the bottom of the screen and when i use the keyboard keep the button visible on the bottom and the keyboard on top of the button?
I dont need the button being pushed up with the keyboard or the keyboard going over the button.
I need the button usable and visible on the bottom of the screen and the keyboard on top of it.
Edittext -
Keyboard -
Button -
Thanks!
In Manifest.xml. Add this line android:windowSoftInputMode="adjustResize" in activity tag
<activity
android:name=".MainActivity"
android:exported="true"
android:windowSoftInputMode="adjustResize">
...
Try adding this to your Manifest.xml
<activity
android:name=".ui.messages.ChatActivity"
android:fitsSystemWindows="true"
android:windowSoftInputMode="adjustResize" />

windowSoftInputMode=“adjustResize” doesn't work in my Activity

I have form-like editTexts and my softkeyboard is overlapping editText field. In my FragmentActivity I just set windowSoftInputMode=“adjustResize” in my AndroidManifest (or in onCreate()) and it works. But in my regular Activity I set this and it doesnt work at all.
I cant set android:fitsystemwindow="true" because it will destroy my layout with transparent statusBar and not transparent navigationBar.
AndroidManifest
<activity
android:name=".ProfilePackage.EditProfile.EditProfileActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"
android:label="#string/app_name">
</activity>
<activity
android:name=".Activities.CommentActivity"
android:windowSoftInputMode="adjustPan" />
I had the same Problem where the Softkeyboard was covering other views. So I added this line in manifest.

Android PreferenceActivity wiered behaviour

In my application Preference Setting Activity is not showing correctly sometimes. It goes black.
My Original Preference Activity
But sometimes it goes black and shows as below screenshot
no check boxes and list preference are visible.
When it goes black and I scroll It looks very poor
The Declaration in Manifest file
<activity
android:name="com.test.wallpaper.PreferenceSettingActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
You have need to set Background for parent layout in this xml page.
Use setbackground for parent layout in xml.

softInputMode in fragments

I have a NavigationDawer with some fragments which contain EditTexts. When I 'open' the fragment, the layout is fine (ie. not squashed) but when I bring the keyboard up, the layout becomes squashed.
I searched around and added this to the manifest:
<activity
android:name=".Navigation_Drawer"
android:label="#string/app_name"
android:windowSoftInputMode="adjustResize" > // This being the important part
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Because the Navigation Drawer is the only activity that contains/starts these fragments, the fragment's softInputMode should be controlled by the activity, but this code does not make any difference
Thank you
Remove the code:
android:windowSoftInputMode="adjustResize"
from manifest file.
Have you tried setting the windowSoftInputMode to adjustPan?
adjustResize will resize the activity to allow room for the keyboard, which is the behaviour you are experiencing. If you set the windowSoftInputMode to adjustPan, the activity will be be 'panned', or moved upwards to make room for the keyboard.
android:windowSoftInputMode="adjustPan"

Keyboard covers up part of edittext

I have a numberpicker but my keyboard is not showing up like I want.
Screen:
As you can see, the keyboard covers part of the edittext.
How can I fix this without using a scrollview?
I've already tried setting android:windowSoftInputMode="adjustPan" or "adjustResize".
When I use scrollview I get the following problem :
Screen shifts a bit when change focus to next edittext
Thx :)
in manifest file set activity attribute
android:windowSoftInputMode="adjustResize|stateHidden"
like :
<activity
android:name=".LoginActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="adjustResize|stateHidden" >
it should work

Categories

Resources