title: Logic Error with object from JSONArray
body: <p>I try load the subject details but it only give the value from the first row of table(student) even I choose the different subject.</p>
  
  <p>I have check the value of id that bring from the previous section. The id seems fine.</p>
  
  <p>Please help me.</p>
  
  <p>This is the code where I bring the value.</p>
  
  <pre><code>          // getting id from intent
         user_id= i.getStringExtra(TAG_USER_ID);
      TextView test = (TextView) findViewById(R.id.user_id);
      test.setText(user_id);
  </code></pre>
  
  <p>This is the code of JSON.</p>
  
  <pre><code>protected JSONObject doInBackground(String... args) {
  
          JSONObject json = null;     
  
          try {
                  //Building parameters
                  List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
                  params.add(new BasicNameValuePair("user_id", user_id));
  
                  json = jsonParser.makeHttpRequest(url_subject_details, "GET", params);
  
                  // check your log for json response
                  Log.d("Single Subject Details", json.toString());
              }
  
          catch(Exception e)
              {
                e.printStackTrace();
              }   
          return json;
  
      }
  
  
  protected void onPostExecute(JSONObject  json) {
          super.onPostExecute(json);
          // dismiss the dialog once product deleted
          pDialog.dismiss();
  
  
          try{
              // json success tag     
              int success;
  
              success = json.getInt(TAG_SUCCESS);
  
              // successfully received subject details
              JSONArray studentObj = json.getJSONArray(TAG_STUDENT); // JSON Array
  
              // get subject object from JSON Array
              JSONObject subject = studentObj.getJSONObject(0);
  
              if (success == 1) {                                          
                  txtName = (EditText) findViewById(R.id.inputName);
                  txtEmail = (EditText) findViewById(R.id.inputEmail);
  
                  // display subject data in EditText
                  txtName.setText(subject.getString(TAG_NAME));
                  txtEmail.setText(subject.getString(TAG_EMAIL)); 
              } else {
  
              }
          } catch (Exception e) {
                e.printStackTrace();
          }
      }
  </code></pre>
  
  <p>This is JSONParser.java</p>
  
  <pre><code>public class JSONParser {
  
  static InputStream is = null;
  static JSONObject jObj = null;
  static String json = "";
  
  // constructor
  public JSONParser() {
  
  }
  
  // function get json from url
  // by making HTTP POST or GET mehtod
  public JSONObject makeHttpRequest(String url, String method,
          List&lt;NameValuePair&gt; params) {
  
      // Making HTTP request
      try {
  
          // check for request method
          if(method == "POST"){
              // request method is POST
              // defaultHttpClient
              DefaultHttpClient httpClient = new DefaultHttpClient();
              HttpPost httpPost = new HttpPost(url);
              httpPost.setEntity(new UrlEncodedFormEntity(params));
  
              HttpResponse httpResponse = httpClient.execute(httpPost);
              HttpEntity httpEntity = httpResponse.getEntity();
              is = httpEntity.getContent();
  
          }else if(method == "GET"){
              // request method is GET
              DefaultHttpClient httpClient = new DefaultHttpClient();
              String paramString = URLEncodedUtils.format(params, "utf-8");
              url += "?" + paramString;
              HttpGet httpGet = new HttpGet(url);
  
              HttpResponse httpResponse = httpClient.execute(httpGet);
              HttpEntity httpEntity = httpResponse.getEntity();
              is = httpEntity.getContent();
          }           
  
  
      } catch (UnsupportedEncodingException e) {
          e.printStackTrace();
      } catch (ClientProtocolException e) {
          e.printStackTrace();
      } catch (IOException e) {
          e.printStackTrace();
      }
  
      try {
          BufferedReader reader = new BufferedReader(new InputStreamReader(
                  is, "iso-8859-1"), 8);
          StringBuilder sb = new StringBuilder();
          String line = null;
          while ((line = reader.readLine()) != null) {
              sb.append(line + "\n");
          }
          is.close();
          json = sb.toString();
      } catch (Exception e) {
          Log.e("Buffer Error", "Error converting result " + e.toString());
      }
  
      // try parse the string to a JSON object
      try {
          jObj = new JSONObject(json);
      } catch (JSONException e) {
          Log.e("JSON Parser", "Error parsing data " + e.toString());
      }
  
      // return JSON String
      return jObj;
  
  }
   }
  </code></pre>