Skip to content

Instantly share code, notes, and snippets.

@ParisaRashidi
Created July 25, 2016 15:55
Show Gist options
  • Save ParisaRashidi/b8735c3d3c2adfabbd231b54a47cea60 to your computer and use it in GitHub Desktop.
Save ParisaRashidi/b8735c3d3c2adfabbd231b54a47cea60 to your computer and use it in GitHub Desktop.
public void requesSecondPage() {
RequestQueue queue = Volley.newRequestQueue(this);
String url = "http://leyliomajnoonapp.ir/panel/ws1.php?type=type=items&start=0&catid=\"+value+\"&id=0&total=10";
StringRequest stringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Toast.makeText(SecondPage.this, "the response of second page is :" + response, Toast.LENGTH_LONG).show();
Log.d(TAG, "Response " + response);
Gson mGson = new Gson();
ContentAnswer contentAnswer = mGson.fromJson((response), ContentAnswer.class);
secodAdapter = new secondPageAdapter(SecondPage.this, contentAnswer.content);
secondPageRecycler.setAdapter(secodAdapter);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
// Log.d(TAG, "Error " + error.getMessage());
}
});
queue.add(stringRequest);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment