title: How to get values from json String
body: <p>I have a json string string from which I want to get the values. It is in key pair form so I want the values for each key.</p>
  
  <p>I tried to get the values but I am not getting it.</p>
  
  <p>Json String is like :</p>
  
  <pre><code>{
      "document": {
          "xmlns:xsi": "http:\/\/www.w3.org\/2001\/XMLSchema-instance",
          "xsi:schemaLocation": "http:\/\/ocrsdk.com\/schema\/recognizeard-1.0.xsd http:\/\/ocrsdk.com\/schema\/recognized-1.0.xsd",
          "xmlns": "http:\/\/ocrsdk.com\/schema\/recognize-1.0.xsd",
          "businessCard": {
              "imageRotation": "noRotation",
              "field":
  
                  [{
                  "type": "Name",
                  "value": "Rafcev B. Agnrwal"
              }, {
                  "type": "Company",
                  "value": "VJ&gt;"
              }, {
                  "type": "Text",
                  "value": "Dr. Rafcev B. Agnrwal\nMOB 0324%\nun\n) AOM*. founts. sso\nVJ&gt;\nT"
              }]
          }
      }
  }
  </code></pre>
  
  <p>I want to get values of "Name", "Address", "Company" etc.</p>
  
  <p>I tried to get like this:</p>
  
  <pre><code>JSONArray array;
  if(mIntent.getStringExtra("jsonString") != null) {
              Log.d("json", mIntent.getStringExtra("jsonString"));
  
          try {
              JSONObject object = new JSONObject(mIntent.getStringExtra("jsonString"));
  
              array = object.getJSONArray("field");
  
              for (int i = 0; i &lt; array.length(); i++) {
                  JSONObject subObject1 = array.getJSONObject(i);
  
                  edt_FirstName.setText(object.getString("Name"));
              }
  
          } catch (JSONException e) {
  
  }
  </code></pre>
  
  <p>Can anyone help me out please? Thank you..</p>
  
  <p>EDIT:</p>
  
  <p>I tried to check values like this:</p>
  
  <pre><code>for (int i = 0; i &lt; array.length(); i++) {
      JSONObject subObject1 = array.getJSONObject(0);
  
      String type = subObject1.getString("type");
      String value = subObject1.getString("value");
      if (type.equals("Name")) {
          edt_FirstName.setText(value);
      }
      if(type.equals("Address"))
      {
          edt_address.setText(value);
      }
      if(type.equals("Company"))
      {
          edt_company.setText(value);
      }
      if(type.equals("Mobile"))
      {
          edt_Mobile.setText(value);
      }
  }
  </code></pre>
  
  <p>I want to get all the values from field array and set to the text view, but I am getting only the Name value and not the others.</p>
  
  <p>Also I could get one field as twice like Mobile I can get twice, so I want to combine both the Mobile values and show it.</p>