Hi Everyone iam new to Android and stuck in really silly problem in my project i have one EditText which is defined in Header View of a List View whenever users touches the EditText soft keyboard will be displayed. i have something called clear button which clears the EditText After clearing soft keyboard is not displaying in 2.3 devices.Whenever i press lock/power button lock the device and unlock then soft keyboard is displaying
<activity
android:name=".pl.Mobile.AddJobNew"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="landscape"
android:windowSoftInputMode="stateVisible|adjustResize|adjustPan"
>
Here is My Activity Declaration in Android for android:windowSoftInputMode : 'adjustResize' option working perfectly for Android 2.3 devices but failed in 4.0 devices where soft keyboard overlapping over edit text . option 'adjustPan' is workin good in 4.0 devices but failed in 2.3 devices
Please help me get out of this problem.
Thanks in Advance
I think that the problem is that when you click the clear button, the editText looses its focus so the keyboard hides itself.
I would try 2 things to solve it;
after you clean the text, do:
yourEditTextField.requestFocus()
manually control the keyboard visibility:
public void showKeyboard(){ View view = getWindow().getCurrentFocus(); if (view==null) return;
}
public void hideKeyboard(){ View view = getWindow().getCurrentFocus(); if (view==null) return;
}
Try this in the activity with the edit text:
Also remove,
From your activity in the manifest file.
Build.Version
I have below line in My AndroidManifest.xml file and it works great. Please try this code. Dont put any extra code. And still if you not get any success then let me know. I will like to help you out.
Try with above code for your activity.
Try something like that
If it not work for you try to add
Also is good to remove request focus from layout. and maybe set this android:windowSoftInputMode="stateHidden|stateAlwaysHidden" in manifest on activity