title: Get the (several) EditText values from list view and post as an array
body: <p>I am developing an android application in which a user gets a json data from the server and put it in list view.</p>
  
  <p>In List view, each Item has some textViews and EditText. Now I want the user to input a number in EditTexts and send the values back to server.</p>
  
  <p>Order.Java:</p>
  
  <pre><code>public class Order extends ListActivity {
      UserFunctions userFunctions;
      SessionManager session;
      TextView text;
      private static final String URL = "http://mydomain.in/webservice/json_sas.php";
  
      private static final String TAG_SUCCESS = "success";
      private static final String TAG_ITEM = "Item";
      private static final String TAG_POSTS = "posts";
      private static final String TAG_SALE = "sale";
  
      private JSONArray mComments = null;
      private ArrayList&lt;HashMap&lt;String, String&gt;&gt; mCommentList;
      private JSONArray sasTotal = null;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_order);
          new LoadOrderForm().execute();
      }
  
      /**
       * Retrieves recent products data from the server.
       */
      public void updateJSONdata() {
          session = new SessionManager(getApplicationContext());
  
          HashMap&lt;String, String&gt; user = session.getUserDetails();
          String cc = user.get(SessionManager.KEY_CC);
          mCommentList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  
          List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
          params.add(new BasicNameValuePair("cc", cc));
  
          Log.d("request!", "starting");
          JSONParser jParser = new JSONParser();
          JSONObject json = jParser.makeHttpRequest(URL, "POST", params);
  
          try {
              mComments = json.getJSONArray(TAG_POSTS);
              for (int i = 0; i &lt; mComments.length(); i++) {
                  JSONObject c = mComments.getJSONObject(i);
  
                  // gets the content of each tag
                  String item = c.getString(TAG_ITEM);
                  String pack = c.getString(TAG_PACK);
                  String bal = c.getString(TAG_BAL);
                  String sale = c.getString(TAG_SALE);
                  String LM1 = c.getString(TAG_LM1);
                  String LM2 = c.getString(TAG_LM2);
  
                  // creating new HashMap
                  HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
  
                  map.put(TAG_ITEM, item);
                  map.put(TAG_PACK, pack);
                  map.put(TAG_BAL, bal);
                  map.put(TAG_SALE, sale);
                  map.put(TAG_LM1, LM1);
                  map.put(TAG_LM2, LM2);
                  // adding HashList to ArrayList
                  mCommentList.add(map);
              }
              sasTotal = json.getJSONArray(TAG_SASARRAY);
  
              // looping through all posts according to the json object returned
              for (int i = 0; i &lt; sasTotal.length(); i++) {
                  JSONObject d = sasTotal.getJSONObject(i);
                  // gets the content of each tag
                  String sval = d.getString(TAG_SVAL);
              }
          } catch (JSONException e) {
              e.printStackTrace();
          }
      }
  
      /**
       * Inserts the parsed data into the listview.
       */
      private void updateList() {
          ListAdapter adapter = new SimpleAdapter(this, mCommentList,
              R.layout.single_post_order, new String[] { TAG_ITEM,
              TAG_SALE,TAG_BAL }, new int[] { R.id.Item, R.id.sale, R.id.stk });
  
          setListAdapter(adapter);
          ListView lv = getListView();    
          lv.setOnItemClickListener(new OnItemClickListener() {
              @Override
              public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                  int position, long id) {
              }
          }); 
      }
  
      public class LoadOrderForm extends AsyncTask&lt;Void, Void, Boolean&gt; {
          @Override
          protected void onPreExecute() {
              super.onPreExecute();
          }
          @Override
          protected Boolean doInBackground(Void... arg0) {
              updateJSONdata();
              return null;
          }
          @Override
          protected void onPostExecute(Boolean result) {
              super.onPostExecute(result);
              updateList();
          }
      }
  }
  }
  </code></pre>
  
  <p>ListActivity looks like this:</p>
  
  <p><a href="https://drive.google.com/file/d/0Bz-FxbI1t7ezMzVoUWo3NXBlWW8/edit?usp=sharing" rel="nofollow">https://drive.google.com/file/d/0Bz-FxbI1t7ezMzVoUWo3NXBlWW8/edit?usp=sharing</a></p>
  
  <p>Now I would like to learn:</p>
  
  <ol>
  <li>How can I detect that user has entered numbers in EditTexts of many Items? </li>
  <li>How can I collect the id or name from texview and Qty entered in Edittext? </li>
  <li>How can I post them back to my the server as an ARRAY?</li>
  </ol>