각 EditText를 다른 것과 구분하려고합니다.편집 상자를 서로 관련시키지 마십시오.
그러나 첫 번째 EditText를 선택하면 제출 또는 확인 대신 다음 EditText가 표시되어 다음 EditText로 이동합니다.
다음은 XML 코드입니다. 첫 번째 텍스트를 편집에
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.ommabdelhafiz.amathmess.MainActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="140dp"
android:layout_height="wrap_content"
android:text="7"
android:textSize="32sp"
android:id="@+id/first_1st"/>
<TextView
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="×"
android:textSize="32sp"
/>
<TextView
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="7"
android:textSize="32sp"
android:id="@+id/first_2nd"/>
<TextView
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="="
android:textSize="32sp"
/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="32sp"
android:hint="Ans"
android:inputType="number"
android:maxLength="3"
android:id="@+id/first_ans"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="16dp"
android:layout_gravity="center_horizontal"
android:id="@+id/first_true_ans"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="16dp"
android:gravity="bottom"
android:layout_gravity="center_horizontal"
android:id="@+id/first_false_ans"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="140dp"
android:layout_height="wrap_content"
android:text="49"
android:textSize="32sp"
android:id="@+id/second_1st"/>
<TextView
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="÷"
android:textSize="32sp"
/>
<TextView
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="7"
android:textSize="32sp"
android:id="@+id/second_2nd"/>
<TextView
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="="
android:textSize="32sp"
/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="32sp"
android:hint="Ans"
android:inputType="number"
android:maxLength="2"
android:id="@+id/second_ans"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="16dp"
android:layout_gravity="center_horizontal"
android:id="@+id/second_true_ans"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="16dp"
android:gravity="bottom"
android:layout_gravity="center_horizontal"
android:id="@+id/second_false_ans"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="140dp"
android:layout_height="wrap_content"
android:text="711"
android:textSize="32sp"
android:id="@+id/third_1st"/>
<TextView
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="×"
android:textSize="32sp"
/>
<TextView
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="7"
android:textSize="32sp"
android:id="@+id/third_2nd"/>
<TextView
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="="
android:textSize="32sp"
/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="32sp"
android:hint="Ans"
android:inputType="number"
android:maxLength="4"
android:id="@+id/third_ans"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="16dp"
android:layout_gravity="center_horizontal"
android:id="@+id/third_true_ans"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="16dp"
android:gravity="bottom"
android:layout_gravity="center_horizontal"
android:id="@+id/third_false_ans"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</RelativeLayout>
편집 후 데이터를 처리하려면이 링크가 [Edittext가 포커스를 잃었을 때 어떻게 알 수 있습니까?] (http://stackoverflow.com/questions/10627137/how-can-i-know) -when-a-edittext-lost-focus) – MikeT