How to set focus on spinner from edit text soft keyboard next button click?

android-edittext, android-fragments, android-radiogroup, android-spinner

Solution

editTextBefore.setOnEditorActionListener(new OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView textView, int actionId, KeyEvent event) {
    if (actionId == EditorInfo.IME_ACTION_NEXT) {
        hideKeyboard();
        textView.clearFocus();
        spinner.requestFocus();
        spinner.performClick();
    }
    return true;
}
});

This answer copy from LINK

Problem

Example: I've registration form fields like: - Enter Name -> Edit text (default set focus) - Gender -> radio button list (a.male and b.female) - City list-> Spinner I want to make like these: - Fragment is load and focus on edit text filed and open a soft keyboard. - When I pressed the soft keyboard next key set focus on gender to select male or female. - Then pressed again soft keyboard next key set focus on city list(spinner) to select city. It is possible to make such functionality?

Original source

Related problems