I have searched a lot for a solution but nothing works.
Update: post at bottom
I have a ScrollView and a FrameLayout as child. Then I set up some EditText programmatically with LayoutParams.
Furthermore, I activated the ime options, so it will go to the next Edittext automatically. When it now goes to the next one, the layout doesn't scroll up and the keyboard hides the EditText.
Answers like android:windowSoftInputMode="adjustPan / adjustResize" didn't work. I also tried to scroll manually with
Spieler1.setOnKeyListener(new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
if ((event.getAction() == KeyEvent.ACTION_DOWN) &&
(keyCode == KeyEvent.KEYCODE_ENTER)) {
int current_pos = scroll2.getScrollY();
scroll2.smoothScrollTo(0,(int)(current_pos + height/4));
scroll2.post(new Runnable() {
@Override
public void run() {
Spieler2.requestFocus();
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
}
});
return true;
}
return false;
}
});
Strange things happened: It wanted to scroll up, but then suddenly goes back to the original position covering the EditText.
I have no idea, why it doesn't scsroll up, but maybe you have.
Thanks for answering.