Monday, 7 March 2016

Android adjustpan not working after the first time



http://stackoverflow.com/questions/15317157/android-adjustpan-not-working-after-the-first-time


subclassed EditText and overridden the method onKeyPreIme(int keyCode, KeyEvent event) like this:
   @Override
   public boolean onKeyPreIme(int keyCode, KeyEvent event)
   {
      if(keyCode == KeyEvent.KEYCODE_BACK)
        {
            clearFocus();
        }
   return super.onKeyPreIme(keyCode, event);
   }
Now when the back key is pressed, the EditText lost the focus. Then tapping it again adjustpan will work.



No comments:

Post a comment