outermost layout . Addonlayoutchangelistener (New Onlayoutchangelistener () {
@Override
public void Onlayoutchange (View arg0, int arg1, int arg2, int arg3,
int arg4, int arg5, int arg6, int arg7, int arg8) {
TODO auto-generated Method Stub
if (EditText. Hasfocus ()) {
/**
* There is no use of handler, so Sroderscrollview will not scroll to the bottom. Just scrolls the initialization height.
* All scroll to the bottom if scrollview too long will cause edittext to roll out of the screen
* New Handler (). Post (New Runnable (
* public void Run () {
* Scrollview.fullscroll (Scrollview.focus_down);
* }));
*/
Scrollview.fullscroll (Scrollview.focus_down);
Edittext.requestfocus ();
}
}
});
Android monitors the state of the keyboard by listening for changes in the outermost layout, which changes the outer layout of the soft keyboard (provided the mode of activity is set to compress).