I want to change the focus from edit-text field to a submit button when done is clicked on the soft input.
I've the following code :
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="5sp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Driver + Conductor :"
android:textSize="17sp"
android:textStyle="bold" />
<EditText
android:id="@+id/bus_driver_above60"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:hint="Driver"
android:inputType="numberDecimal"
android:textAlignment="center"
android:textColor="#000"
android:nextFocusDown="@+id/bus_conductor_above60"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:text="+"
android:textSize="17sp"
android:textStyle="bold" />
<EditText
android:id="@+id/bus_conductor_above60"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_weight="1"
android:hint="Conductor"
android:inputType="numberDecimal"
android:textAlignment="center"
android:textColor="#000"
android:nextFocus="@+id/bus_above60_btn"/>
</LinearLayout>
<Button
android:id="@+id/bus_above60_btn"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="Calculate"
android:textSize="17sp"
android:textColor="#ffffff"
android:textStyle="bold"
android:background="#3498DB"/>
Here in the code,
android:nextFocusDown="@+id/bus_conductor_above60"
changes the focus from Driver Edit text field to Conductor Edit text field.
But after Conductor Edit text field, there is a Calculate button - bus_above60_btn.
android:nextFocusDown="@+id/bus_above60_btn"
is not changing the focus from Conductor Edit text field to the button below that field.
How do I achieve this?