My case: EditText has no focus, I click EditText, Software Keyboard has displayed, EditText has focus, EditText is not covered by Software Keyboard. Now I click again on EditText ( now EditText has focus ) - keyboard is "reloaded" and it covers EditText. I has no on click listener set to EditText, focusable_in_touch_mode set to true otherwise keyboard won't be displayed. I tried adjustPan, adjustResize with no effect.
Asked
Active
Viewed 868 times
3 Answers
0
just modify your that particular activity in the manifest with the following code,just add this line in that
android:windowSoftInputMode="adjustResize|stateHidden"
For example your activity is MainActivity the you can solve your problem like this
<activity
android:name="com.my.MainActivity"
android:screenOrientation="portrait"
android:label="@string/title_activity_main"
android:windowSoftInputMode="adjustResize|stateHidden" >
</activity>
or try this instead of the above line in the activity in your manifest
android:windowSoftInputMode="adjustPan"

Hanish Sharma
- 869
- 8
- 23
0
1) first put your EditText inside Scroolview in xml file
2) In Java file , do as below.
Edittext et_search=(Edittext)findviewByid(R.id.et_search);
Scrollview scroll=(Scrollview)findviewByid(R.id.scroll);
et_search.setOnFocusChangeListener(new OnFocusChangeListener() {
@Override
public void onFocusChange(View arg0, boolean hasfocus) {
// TODO Auto-generated method stub
if(hasfocus)
{
if(et_search.requestFocus()==true)
{
scroll.scrollTo(0,scroll.getBottom());
}
}
}
});

shailesh Rohit
- 407
- 5
- 6