Setting nextFocus for EditTexts does not work

I have a problem with attributes nextFocus... EditText. Firstly, it is very difficult for me to understand which of the parameters nextFocus...I should use. When I click Nexton my soft keyboard, it searches for the next EditText, but how should I know if it is looking down or up or anywhere? I still have to specify the identifier of the next view so that it focuses, so why bother with directions at all?

Anyway, this is my layout: http://imgur.com/na1xn2s

And when I edit Stacks, I want the next one to EditTextbe Rest, but it doesn't work. This is my code:

stacks = (EditText) dialogView.findViewById(R.id.calc_stacks_edit);
rest = (EditText) dialogView.findViewById(R.id.calc_rest_edit);
stacks.setImeOptions(EditorInfo.IME_ACTION_NEXT);
stacks.setNextFocusDownId(R.id.calc_rest_edit);
rest.setImeOptions(EditorInfo.IME_ACTION_DONE);

It still proceeds to the sum of the EditTextRest insert when the Next button is clicked. What is the problem?

+4
source share
1 answer

From XML, set these attributes to the stack.

  android:nextFocusForward="@+id/rest"
    android:inputType="textNoSuggestions"
    android:imeOptions="actionNext"
+10
source

All Articles