I found an intelligent solution (e.g. to go down):
bic=new BaseInputConnection(this.getWindow().getDecorView(),false); KeyEvent event2 = new KeyEvent(0, 0, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_DOWN,0, KeyEvent.META_SYM_ON, 0, 0, KeyEvent.FLAG_VIRTUAL_HARD_KEY); bic.sendKeyEvent(event2);
That's all, an internal algorithm for finding the next element in your chosen direction
source share