constructor - url + responseListener + errorListener
İmzası şöyle
+ responseListener + errorListener
Şöyle yaparız.
İmzası şöyle
JsonArrayRequest(java.lang.String url,
Response.Listener<JSONArray> listener,
Response.ErrorListener errorListener)
Listener şöyledir.class ResponseListener implements Response.Listener<JSONArray>
{
@Override
public void onResponse(JSONArray response)
{
...
}
}
class ErrorListener implements Response.ErrorListener
{
@Override
public void onErrorResponse(VolleyError error)
{
...
}
}
constructor - method + url + requestBody Şöyle yaparız.
JsonArrayRequest jsonArrayRequest = new JsonArrayRequest(
Request.Method.POST,
"http://abc.com.net/api/LoadDiaryTweetLinesByUser",
obj,
new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
...
}
},
new Response.ErrorListener(){
@Override
public void onErrorResponse(VolleyError error){
...
}
}
);
Hiç yorum yok:
Yorum Gönder