How to get text of all editText?
I need to go in a cycle over all edittext.
I have 16 editText and in cycle need get text of all in turns.
i was try
TableLayout or = (TableLayout) findViewById(R.id.TableLayoutBells);
EditText editTextBells = (EditText) or.getChildAt(i).findViewById(R.id.TableLayoutBells);
but it dont work
this is my layout:
<?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:id="@+id/RelativeLayoutScheduleOfBellsEdit"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/back1"
android:visibility="visible"
tools:context=".MainActivity" >
<ImageView
android:id="@+id/imageViewTopScheduleOfBellsEdit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/top_schedule_of_bells" />
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/imageViewTopScheduleOfBellsEdit"
android:layout_above="@+id/LinearLayoutOkCancelScheduleOfBellsEdit">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TableLayout
android:id="@+id/TableLayoutBells"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@drawable/grid_view_notes_background" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp" >
<TextView
android:id="@+id/TextView03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="1st lesson:"
android:textAppearance="?android:attr/textAppearanceLarge" />
<EditText
android:id="@+id/EditText1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="50"
android:background="@drawable/edittext_edit_text_holo_light"
android:ems="10"
android:inputType="time"
android:maxLength="5"
android:tag="0" >
<requestFocus />
</EditText>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="—"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
<EditText
android:id="@+id/EditText01"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="50"
android:background="@drawable/edittext_edit_text_holo_light"
android:ems="10"
android:inputType="time"
android:maxLength="5"
android:tag="1" />
</TableRow>
...
</TableLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/LinearLayoutOkCancelScheduleOfBellsEdit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:orientation="horizontal" >
<ImageView
android:id="@+id/imageViewCancelScheduleOfBellsEdit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/cancel_click" />
<ImageView
android:id="@+id/imageViewOkScheduleOfBellsEdit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:src="@drawable/ok_click" />
</LinearLayout>
</RelativeLayout>