Б қосымшасының жалғасы
@Override
public void onResponse(String response) {
progressDialog.dismiss();
try {
JSONArray JA = new JSONArray(response);
for (int i = 0; i < JA.length(); i++) {
JSONObject JO = (JSONObject) JA.get(i);
NewsList newsList = new NewsList(JO.getString("title"),
JO.getString("text"),
JO.getString("image"), JO.getString("date"));
newsLists.add(newsList);
}
adapter = new NewsAdapter(newsLists,
getActivity().getApplicationContext());
recyclerView.setAdapter(adapter);
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.
Достарыңызбен бөлісу: