title: Android - Get each EditTexts values of ListView with custom ArrayAdapter
body: <p>I've got a ListView with a customer ArrayAdapter and a custom ListItem-XML. At the bottom of this ListView I've added a FooterView with a Button. Now I want to get all the values of the three EditTexts in each of my ListItems when I click this Button.</p>
  
  <p>Here below is my code:</p>
  
  <p>activity_checklistresult.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;ListView
          android:id="@android:id/list"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>result_inner_view.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/item_layout"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal"
      android:gravity="center"&gt;
  
      &lt;TextView
          android:id="@+id/tv_result_amount"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_margin="@dimen/default_margin" /&gt;
      &lt;EditText
          android:id="@+id/et_result_amount"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_margin="@dimen/default_margin"
          android:inputType="number" /&gt;
  
      &lt;LinearLayout
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:gravity="center_vertical"
          android:orientation="vertical"&gt;
  
          &lt;TextView
              android:id="@+id/tv_result_product_name"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:singleLine="true"
              android:ellipsize="end"
              android:layout_margin="@dimen/default_margin" /&gt;
          &lt;AutoCompleteTextView
              android:id="@+id/actv_search_product"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:singleLine="true"
              android:ellipsize="end"
              android:layout_margin="@dimen/default_margin"
              android:inputType="textAutoComplete" /&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;TextView
          android:id="@+id/tv_result_price"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_margin="@dimen/default_margin" /&gt;
      &lt;EditText
          android:id="@+id/et_result_price"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_margin="@dimen/default_margin"
          android:inputType="numberDecimal" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>ResultListActivity.java:</p>
  
  <pre><code>public class ChecklistResultActivity extends ListActivity
  {
      private MyResultAdapter adapt;
      private Button confirmButton;
      private ChecklistResultActivity rActivity;
  
      @Override
      public void onCreate(Bundle savedInstanceState){
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_checklistresult);
  
          // Set my Custom ArrayAdapter for this ListActivity
          setAdapter();
  
          rActivity = this;
      }
  
      private void setAdapter(){
          adapt = new MyResultAdapter(this, R.layout.result_inner_view, Controller.getInstance().getOrderedProducts());
          setListAdapter(adapt);
  
          // Add the confirm button at the end of the list
          addFooterConfirmButton();
      }
  
      private void addFooterConfirmButton(){
          ListView lv = (ListView)findViewById(android.R.id.list);
          FrameLayout footerLayout = (FrameLayout) getLayoutInflater().inflate(R.layout.result_footer_view, null);
          confirmButton = (Button)footerLayout.findViewById(R.id.confirm_result_button);
          confirmButton.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  ...
  
                  // Get all EditText values (and compare them with the Default Value)
              }
          });
          lv.addFooterView(footerLayout);
      }
  
      ...
  </code></pre>
  
  <p>MyResultAdapter.java:</p>
  
  <pre><code>public class MyResultAdapter extends ArrayAdapter&lt;OrderedProduct&gt;
  {
      private Context context;
      private int layoutResourceId;
      private LayoutInflater inflater;
  
      public MyResultAdapter(Context c, int layoutResourceId, List&lt;OrderedProduct&gt; objects){
          super(c, layoutResourceId, objects);
          this.layoutResourceId = layoutResourceId;
          this.context = c;
          inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent){
          View view = convertView;
          if(view == null)
              view = inflater.inflate(layoutResourceId, parent, false);
  
          ...
  
          return view;
      }
  }
  </code></pre>
  
  <p>In the ResultListActivity at <code>// Get all EditText values (and compare them with the Default Value)</code> I want to loop through all the OrderedProducts and compare the default values of those, with the new filled-in values of the two EditTexts and the AutoCompleteTextView. So how can I get those values from within the onClick of the Footer-Button?</p>
  
  <p>Thanks in advance for the responses.</p>