For me, I did not want to assume that the height of the keyboard is a certain dimension. Whatever you think of creating an onTouchListener, then do the following:
setOnTouchListener(new OnTouchListener() { Runnable shifter=new Runnable(){ public void run(){ try { int[] loc = new int[2];
// essentially we make a runnable that scrolls to a new location of some kind that you WANT to see on the screen. you execute this runnable only if it is not within scrollviews (its not on the screen). Thus, it moves scrollview to a reference view (in my case, "someview", which was a line separator).
source share