title: How to use Android Volley GET method with specified parameter?
body: <p>I know how to use Volley GET method for login purposes but what if I need to specify a specific "id"? I am passing the "id" of a list item from a remote database to another activity using intent.putExtra. In the next activity, how would I utilize Volleys' GET method to parse and display data from another table using that passed over "id"?</p>
  
  <p>In a browser I can use the following to get a response with a specified url and parameter:</p>
  
  <pre><code>http://localhost/demoapp/fetch.php?pid=2
  </code></pre>
  
  <p>But I don't know how to pass that url to a Volley request and display the response in a listview. Something like this:</p>
  
  <pre><code>"http://localhost/demoapp/fetch.php?pid=" + pid
  </code></pre>
  
  <p>Where "pid" would be the passed over string of the corresponding id.</p>
  
  <p><strong>EDIT:PHP Code</strong></p>
  
  <pre><code>    &lt;?php
  include_once("config.php");
  
  $query=mysqli_query($con,"SELECT * FROM comments WHERE pid=".$_GET['pid']);
  
  $array;
  while($result=mysqli_fetch_assoc($query)){
  
  $array[]=$result;
  }
  
  echo json_encode($array);
  ?&gt;
  </code></pre>
  
  <p><strong>EDIT 2: JAVA Code</strong>
  <em>Main Activity</em></p>
  
  <pre><code>    JsonArrayRequest request = new JsonArrayRequest(url+url_file,
                  new Response.Listener&lt;JSONArray&gt;() {
                      @Override
                      public void onResponse(JSONArray response) {
                          Log.d(TAG, response.toString()); try {
                              for(int i=0;i&lt;response.length();i++){
                                  String pid=response.getJSONObject(i).getString("pid");
                                  String name=response.getJSONObject(i).getString("product_name");
                                  String img;
                                  String thumb = response.getJSONObject(i).getString("product_thumb");
                                  String detail = response.getJSONObject(i).getString("product_detail");
                                  String rating = response.getJSONObject(i).getString("product_rating");
  
                                  img = response.getJSONObject(i).getString("product_pic");
  
                                  rowdata.add(new ProductRowData(pid,name,img,thumb,detail,rating));
                              }
                          } catch (JSONException e) {
                              // TODO Auto-generated catch block
                              e.printStackTrace();
                          }
                          adapter=new ProductsAdapter(MainActivity.this, rowdata);
                          list.setAdapter(adapter);
                          dialog.dismiss();
                      }
                  }, new Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError error) {
                  Log.d(TAG, "Error: " + error.getMessage());
                  dialog.dismiss();
              }
          });
  
          VolleyController.getInstance().addToRequestQueue(request, tag_json_arry);
  </code></pre>
  
  <p>When list item is clicked, rest of data is passed over to detail activity using intent.putExtra. What I am then trying to do is, upon clicking on FAB, a list of comments from a different table with that products id should be shown.</p>