0

I need to develop android application It's have multiple forms to fill and then one submit button to all forms to save. Any idea to make this forms connected together? Thanks.

[Edit] Connected together I mean that I can fetch all of them by one click.

Tefa
  • 328
  • 1
  • 4
  • 15

1 Answers1

0
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/container"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

<LinearLayout
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <EditText
        android:hint="First Name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/editTextFisrtName"/>

    <EditText
        android:id="@+id/editTextLastName"
        android:hint="Last Name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />


    <Button
        android:id="@+id/submitButton"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="submit"/>
    </LinearLayout>
</ScrollView>

Tiago Oliveira
  • 1,582
  • 1
  • 16
  • 31
  • I am so sorry I think my choose of word was wrong, I mean by form that the one form has more than one edit text, the XML file you but is one form in my app, I should have more than one like it – Tefa Sep 10 '16 at 23:38
  • so your problem is not building the form but having multiple forms right?, you can use a viewpager or muliple fragments, or you can also use a scrollview and place all forms inside your activity how many forms ? – Tiago Oliveira Sep 10 '16 at 23:47
  • Yes I think you understand me now, I have no problems with how the design look like, so can you tell me please what is the best way from ways you said (viewPager, multiple fragment, scrollView) and the easiest way too. – Tefa Sep 11 '16 at 00:01
  • well it depends fast way is scrollView, viewPager will take a bit more time, multiple fragments will be more complex, i think you will be ok with the scrollview using the scrollview is easy, you just put a layout inside and your views go inside that layout to get the values i think you already know, you place a button on the bottom of the scrollview and attach a clicklistener – Tiago Oliveira Sep 11 '16 at 00:18
  • can you look to this please http://stackoverflow.com/questions/39433634/create-dynamic-view-in-android – Tefa Sep 11 '16 at 07:02