title: Get JSON response when request post by volley
body: <p>I have php file when user post existing ticknumber  the php will echo <code>JSON</code> code for one array of that was posted, I linked it with <code>Activity</code> that will do same job of php file but when I click on button nothing show up in <code>Listview</code> !!</p>
  
  <pre><code>&lt;?php
  
  
      if ($_SERVER ['REQUEST_METHOD']=='POST') {
  
          $ticketnumber = $_POST['ticketnumber'];
  
          require_once('config.php');
  
       $con-&gt;set_charset('utf8');
  
          $sql = " SELECT * FROM contact WHERE ticketnumber = '$ticketnumber' ";
  
          $res = mysqli_query($con, $sql);
  
           $result = array();
  
          while($get = mysqli_fetch_array($res))
          {
              array_push($result,array('ticketnumber' =&gt;$get[5], 'subject' =&gt;$get[4],'response' =&gt;$get[6]));
          }
          if(!empty($result)){
              echo json_encode(array("responseticket"=&gt;$result));
          } else {
              echo " error";
          }
  
  }
  ?&gt;
  </code></pre>
  
  <p><strong>SupportActivity.java</strong></p>
  
  <pre><code>public class supportActivity extends AppCompatActivity implements View.OnClickListener{
  
  private EditText ticketsupport;
  private Button button;
  private List&lt;supportContent&gt; con = new ArrayList&lt;supportContent&gt;();
  private ListView supportlist;
  private supportAdapter adapter;
  private String ticketinput;
  private String url = "http://10.0.3.2/aaa/getticket.php";
  private RequestQueue requestQueue1;
  int i ;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_support);
  
       ticketsupport = (EditText)findViewById(R.id.insertticketnumber);
       supportlist = (ListView)findViewById(R.id.supportlistview);
       adapter = new supportAdapter(this, con);
      supportlist.setAdapter(adapter);
       button = (Button)findViewById(R.id.buttonsupprt);
  
      button.setOnClickListener(this);
  
  
  }
  
  private void inquiry() {
  
           ticketinput = ticketsupport.getText().toString().trim();
  
      StringRequest stringRequest1 = new StringRequest(Request.Method.POST, url,
              new Response.Listener&lt;String&gt;() {
  
                  @Override
                  public void onResponse(String response) {
                      if (response.trim().equals("error")) {
  
                          Toast.makeText(supportActivity.this, "please check the number", Toast.LENGTH_SHORT).show();
                      } else {
  
  
                          try {
                              JSONObject ticket ;
                              JSONArray jsonArray = new JSONArray("responseticket");
                              ticket = jsonArray.getJSONObject(Integer.parseInt(response));
                              supportContent support = new supportContent();
  
                              support.setTicketnumber(ticket.getString("ticketnumber"));
                              support.setSubject(ticket.getString("subject"));
                              support.setResponse(ticket.getString("response"));
  
                              con.add(support);
  
  
                          } catch (JSONException e) {
                              e.printStackTrace();
                          }
                          adapter.notifyDataSetChanged();
  
                      }
                  }
              }, new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError error) {
              Toast.makeText(supportActivity.this, "something wrong" , Toast.LENGTH_SHORT).show();
          }
      }) {
  
          @Override
      protected Map&lt;String,String&gt; getParams() throws AuthFailureError{
              Map&lt;String,String&gt; map = new HashMap&lt;String,String&gt;();
              map.put("ticknumber", ticketinput);
              return map;
          }
      };
  
       requestQueue1 = Volley.newRequestQueue(getApplicationContext());
      requestQueue1.add(stringRequest1);
  
  }
  
  @Override
  public void onDestroy(){
      super.onDestroy();
  }
  
  
  @Override
      public void onClick(View view){
          inquiry();
   }
  }
  </code></pre>
  
  <p><strong>SupportAdapter.java</strong></p>
  
  <pre><code>public class supportAdapter extends ArrayAdapter&lt;supportContent&gt; {
  
  private Context context;
  private List&lt;supportContent&gt; contents;
  
  public supportAdapter(Context context, List&lt;supportContent&gt; con){
      super(context, R.layout.supportcontent, con);
      this.contents = con;
  }
  
  @Override
  public int getCount(){
      return contents.size();
  }
  
  public View getView(int position, View convertview, ViewGroup parent){
  
      LayoutInflater inflater = LayoutInflater.from(getContext());
  
      View supcon = inflater.inflate(R.layout.supportcontent, null);
  
      TextView ticketnumber = (TextView)supcon.findViewById(R.id.ticketnumber);
      ticketnumber.setText(contents.get(position).getTicketnumber());
      TextView supportsubject = (TextView)supcon.findViewById(R.id.supportsubject);
      supportsubject.setText(contents.get(position).getSubject());
      TextView response = (TextView)supcon.findViewById(R.id.response);
      response.setText(contents.get(position).getResponse());
  
      return supcon;
  }
  }
  </code></pre>