imeOptions "actionNext" programmatically - how to jump to next field?

Laimoncijus picture Laimoncijus · Aug 11, 2010 · Viewed 56.6k times · Source

In layout XML it is possible to specify android:imeOptions="actionNext" which adds Next button in virtual keyboard and by clicking on it - focus jumps to the next field.

How to do this programmatically - e.g. based on some event trigger focus to go to the next field?

Answer

Firewall_Sudhan picture Firewall_Sudhan · May 9, 2011

You can use the constants from EditorInfo class for the IME options. like,

editText.setImeOptions(EditorInfo.IME_ACTION_NEXT);