lundi 4 mai 2015

How to prevent android form from skipping sections in form?

I have an Android form consisting of some editText and spinner widgets. When you start with the first edittext and hit "next" on the on-screen keyboard, it skips the spinners and goes straight to the next edittext input. How can I prevent skipping entries regardless of what type of entries they are? i.e., spinner, edittext, dialog, etc. Here's my layout:

<ScrollView xmlns:android="http://ift.tt/nIICcg"
android:id="@+id/ScrollView01" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:scrollbars="vertical"
android:background="@drawable/flagbackground" >
<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="490dp"
    android:gravity="center"
    android:orientation="vertical" >

<TextView android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/vetn"
    android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText android:id="@+id/etVetName"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:inputType="text" />
<TextView android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/vetdob"
    android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText android:id="@+id/etVetDob"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:inputType="date" />
<TextView
    android:layout_width="318dp"
    android:layout_height="wrap_content"
    android:text="@string/phone"
    android:textAppearance="?android:attr/textAppearanceMedium" />

<EditText android:id="@+id/etVetPhone"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="top"
    android:inputType="phone"
    android:hint="@string/optional"
    android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/branch"
    android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
    android:id="@+id/SpinnerBranchType"
    android:layout_height="wrap_content"
    android:prompt="@string/branch"
    android:layout_width="fill_parent"
    android:entries="@array/branchtypelist">
</Spinner>
<TextView android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/gender"
    android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
    android:id="@+id/SpinnerSexType"
    android:layout_height="wrap_content"
    android:prompt="@string/sex"
    android:layout_width="fill_parent"
    android:entries="@array/sexlist">
</Spinner>
<TextView android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/discharge"
    android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
    android:id="@+id/DischargeType"
    android:layout_height="wrap_content"
    android:prompt="@string/distype"
    android:layout_width="fill_parent"
    android:entries="@array/dischargelist">
</Spinner>
<TextView android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/dd214"
    android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
    android:id="@+id/dd214Response"
    android:layout_height="wrap_content"
    android:prompt="@string/dd214"
    android:layout_width="fill_parent"
    android:entries="@array/yesnoanswer"    >

</Spinner>
<TextView android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/home"
    android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
    android:id="@+id/homelessResponse"
    android:layout_height="wrap_content"
    android:prompt="@string/homeless"
    android:layout_width="fill_parent"
    android:entries="@array/yesnoanswer">
</Spinner>
<TextView android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/weekend"
    android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
    android:id="@+id/ngResponse"
    android:layout_height="wrap_content"
    android:prompt="@string/ngrsrv"
    android:layout_width="fill_parent"
    android:entries="@array/yesnoanswer">
</Spinner>
<TextView android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/benefit"
    android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
    android:id="@+id/benefitResponse"
    android:layout_height="wrap_content"
    android:prompt="@string/benefits"
    android:layout_width="fill_parent"
    android:entries="@array/yesnoanswer">
</Spinner>
<TextView android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/foodstamps"
    android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
    android:id="@+id/foodResponse"
    android:layout_height="wrap_content"
    android:prompt="@string/food"
    android:layout_width="fill_parent"
    android:entries="@array/yesnoanswer">
</Spinner>
<TextView android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/cashaid"
    android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
    android:id="@+id/cashResponse"
    android:layout_height="wrap_content"
    android:prompt="@string/cash"
    android:layout_width="fill_parent"
    android:entries="@array/yesnoanswer">
</Spinner>
<TextView android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/ref"
    android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText android:id="@+id/etRefer"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:hint="@string/refhint"
    android:inputType="text" />
<TextView android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/comment"
    android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
    android:id="@+id/etCommentBody"
    android:layout_height="wrap_content"
    android:hint="@string/hint"
    android:inputType="textMultiLine"
    android:lines="5"
    android:layout_width="fill_parent">
</EditText>
<Button android:id="@+id/btnOK"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/submit"
    android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>

Aucun commentaire:

Enregistrer un commentaire