title: Views from HashMap not being named correctly
body: <p>I am attempting to create a dynamic <code>U.I.</code> from a <code>JSON</code> response. I have the following code. </p>
  
  <pre><code>class LoadAllQuestions extends AsyncTask&lt;String, String, String&gt; {
  
      private ProgressDialog pDialog;
  
      JSONParser jParser = new JSONParser();
      JSONArray questions = null;
  
      protected void onPreExecute() {
          super.onPreExecute();
          pDialog = new ProgressDialog(getActivity());
          pDialog.setMessage("Loading questions. Please wait...");
          pDialog.setIndeterminate(false);
          pDialog.setCancelable(true);
          pDialog.show();
      }
  
      protected String doInBackground(String... args) {
  
          // getting JSON string from URL
          companyName = cn.getText().toString();
          projectName = pn.getText().toString();
          String componentName = (String) ab.getSelectedTab().getText();
  
          List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(3);
          nameValuePairs.add(new BasicNameValuePair("company", companyName));
          nameValuePairs.add(new BasicNameValuePair("project", projectName));
          nameValuePairs.add(new BasicNameValuePair("component",
                  componentName));
  
          JSONObject json = jParser.makeHttpRequest(url, "POST",
                  nameValuePairs);
          // Check your log cat for JSON response
          Log.d("All Questions: ", json.toString());
          try {
              // Checking for SUCCESS TAG
              int success = json.getInt(TAG_SUCCESS);
  
              if (success == 1) {
                  Log.v("RESPONSE", "Success!");
                  // products found: getting Array of Questions
                  questions = json.getJSONArray(TAG_QUESTIONS);
  
                  // looping through All Questions
                  for (int i = 0; i &lt; questions.length(); i++) {
  
                      JSONObject c = questions.getJSONObject(i);
  
                      // Storing each JSON item in variable
                      String name = c.getString(TAG_NAME);
                      String field = c.getString(TAG_FIELD);
                      String value = c.getString(TAG_VALUE);
  
                      // creating new HashMap
                      HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
  
                      // adding each child node to HashMap key =&gt; value
                      map.put(TAG_NAME, name);
                      map.put(TAG_FIELD, field);
                      map.put(TAG_VALUE, value);
  
                      infoList.add(map);
                  }
  
              } else {
                  // no products found
                  Log.v("ERROR", "No JSON for you!");
              }
          } catch (JSONException e) {
              e.printStackTrace();
          }
          return null;
      }
  
      protected void onPostExecute(String string) {
          // dismiss the dialog
          pDialog.dismiss();
          // loop through infoList
          for (int i = 0; i &lt; infoList.size(); i++) {
              // get HashMap
              HashMap&lt;String, String&gt; map = infoList.get(i);              
              // if the answer should be a radio button, inflate it
              if (map.get(TAG_FIELD).equals("Radio")) {
                  Log.v("RESPONSE", "About to create a radio button");
                  // find
                  LinearLayout content = (LinearLayout) view
                          .findViewById(R.id.genA_layout);
                  // create
                  TextView tv = new TextView(getActivity());
                  RadioGroup rg = new RadioGroup(getActivity());
                  rg.setOrientation(RadioGroup.HORIZONTAL);
                  RadioButton rb = new RadioButton(getActivity());
                  RadioButton rb2 = new RadioButton(getActivity());
                  LinearLayout ll = new LinearLayout(getActivity());
  
                  // set
                  rb.setLayoutParams(new LinearLayout.LayoutParams(
                          LinearLayout.LayoutParams.MATCH_PARENT,
                          LinearLayout.LayoutParams.MATCH_PARENT));
                  rb2.setLayoutParams(new LinearLayout.LayoutParams(
                          LinearLayout.LayoutParams.MATCH_PARENT,
                          LinearLayout.LayoutParams.MATCH_PARENT));
                  ll.setLayoutParams(new LinearLayout.LayoutParams(
                          LinearLayout.LayoutParams.MATCH_PARENT,
                          LinearLayout.LayoutParams.MATCH_PARENT));
                  rb.setText(TAG_VALUE);
                  rb2.setText(TAG_VALUE);
                  tv.setText(map.get(TAG_NAME));
                  ll.setOrientation(LinearLayout.HORIZONTAL);
                  // add
                  rg.addView(rb);
                  rg.addView(rb2);
                  ll.addView(tv);
                  ll.addView(rg);
                  content.addView(ll);
              }
              // else inflate the view as an EditText field
              else if (map.get(TAG_FIELD).equals("Text Field")) {
                  Log.v("RESPONSE", "About to create an EditText");
                  // find
                  LinearLayout content = (LinearLayout) view
                          .findViewById(R.id.genA_layout);
                  // create
                  TextView tv = new TextView(getActivity());
                  EditText et = new EditText(getActivity());
                  LinearLayout ll1 = new LinearLayout(getActivity());
                  // set
                  tv.setLayoutParams(new LinearLayout.LayoutParams(
                          LinearLayout.LayoutParams.MATCH_PARENT,
                          LinearLayout.LayoutParams.MATCH_PARENT));
                  et.setLayoutParams(new LinearLayout.LayoutParams(
                          LinearLayout.LayoutParams.MATCH_PARENT,
                          LinearLayout.LayoutParams.MATCH_PARENT));
                  ll1.setLayoutParams(new LinearLayout.LayoutParams(
                          LinearLayout.LayoutParams.MATCH_PARENT,
                          LinearLayout.LayoutParams.MATCH_PARENT));
                  tv.setText(map.get(TAG_NAME));
                  ll1.setOrientation(LinearLayout.HORIZONTAL);
                  // add
                  ll1.addView(tv);
                  ll1.addView(et);
                  content.addView(ll1);
              } else if (map.get(TAG_FIELD).equals("Check Box")) {
                  Log.v("RESPONSE", "About to create a CheckBox");
                  // find
                  LinearLayout content = (LinearLayout) view
                          .findViewById(R.id.genA_layout);
                  // create
                  TextView tv = new TextView(getActivity());
                  CheckBox cb = new CheckBox(getActivity());
                  LinearLayout ll = new LinearLayout(getActivity());
  
                  // set
                  cb.setLayoutParams(new LinearLayout.LayoutParams(
                          LinearLayout.LayoutParams.MATCH_PARENT,
                          LinearLayout.LayoutParams.MATCH_PARENT));
                  ll.setLayoutParams(new LinearLayout.LayoutParams(
                          LinearLayout.LayoutParams.MATCH_PARENT,
                          LinearLayout.LayoutParams.MATCH_PARENT));
                  tv.setText(map.get(TAG_NAME));
                  ll.setOrientation(LinearLayout.HORIZONTAL);
                  // add
                  ll.addView(tv);
                  ll.addView(cb);
                  content.addView(ll);
  
              } else if (map.get(TAG_FIELD).equals("Drop Down Menu")) {
                  Log.v("RESPONSE", "About to create a Drop Down Menu");
              }
  
          }
  
          // find
          LinearLayout loader = (LinearLayout) view
                  .findViewById(R.id.loader_layout);
          Button save = (Button) view
                  .findViewById(R.id.generalAssets_save_button_ID);
          // set
          loader.setVisibility(View.GONE);
          save.setVisibility(View.VISIBLE);
  
      };
  }
  </code></pre>
  
  <p>and the <code>JSON</code></p>
  
  <pre><code>{
      "questions": [
          {
              "display_name": "Store #",
              "field_type": "Text Field",
              "option_value": ""
          },
          {
              "display_name": "Address",
              "field_type": "Text Field",
              "option_value": ""
          },
          {
              "display_name": "Type of Business",
              "field_type": "Drop Down Menu",
              "option_value": "Education\r\nHealth\r\nComputers\r\nFood\r\nRetail\r\nOther"
          },
          {
              "display_name": "Is this business good?",
              "field_type": "Radio",
              "option_value": "Yes\r\nNo"
          },
          {
              "display_name": "Are they nice people?",
              "field_type": "Check Box",
              "option_value": "Yes\r\nNo"
          }
      ],
      "success": 1
  }
  </code></pre>
  
  <p>Now I want it to look like this</p>
  
  <pre><code>Store # ------------------ &lt;EditText&gt;
  Address ------------------ &lt;EditText&gt;
  Is this business good? --- &lt;RadioButton&gt; (Yes) &lt;RadioButton&gt; (No)
  Type of business? -------- &lt;Spinner&gt; (Education\r\nHealth\r\nComputers\r\nFood\r\nRetail\r\nOther)
  </code></pre>
  
  <p>etc, However right now it's doing this, <em>literally</em>, these are the values I see.</p>
  
  <pre><code>Store# ------------------ nothing
  Address ----------------- nothing
  Is this business good?--- &lt;RadioButton&gt; (option_value) &lt;RadioButton&gt; (option_value)
  Are they nice people?---- &lt;CheckBox&gt;
  </code></pre>
  
  <p>So this may of been more code than you needed to see but I wanted to make sure you fully understood what was going on.</p>
  
  <p>*<em>edited to show changes</em></p>
  
  <p>After the edit it's working, kind of... I will post another question if I need more help with this. Original Problem solved. Special Thanks @sarwar</p>