OnResponse code :
card_list = new Gson().fromJson(_response, new TypeToken>>(){}.getType());
if (card_list.size() > 5) {
recyclerview1.setAdapter(new Recyclerview1Adapter(card_list));
}else{
SketchwareUtil.showMessage(getApplicationContext(), _response);
}
Json 200 Result like :
{
"user": [
{
"id": "string",
"address": "string",
"contact": "string",
"name": "string",
"description": "string",
"image_url": ""
},{...},{...}
],
"next": "string"
}
But have the error when opening an activity :
BEGIN_ARRAY but was STRING at line 1 column 1
Please help me solve the code to retrieve json array to listmap for recyclerview in java android or sketchware
Try your code this way: