BEGIN_ARRAY but at row 1, column 1 is STRING java android sketchware
php editor Zimo brings you an article about solutions to problems encountered in programming. When writing code, sometimes you will encounter some error prompts, such as the "STRING java android sketchware" error in row 1 and column 1. This error message actually appears when using the wrong array writing method. Below we will work together to solve this problem so that the code can run normally.
Question content
Response code:
65bee13b5a05djson 200 The results are as follows:
65bee13b5a06cBut an error occurred when opening the activity:
begin_array, but in row 1, column 1 is string
Please help me with the code to retrieve json array to list map for recyclerview in java android or sketchware
Solution
Try your code like this:
try { jsonobject jsonresponse = new jsonobject(_response); jsonarray userarray = jsonresponse.getjsonarray("user"); card_list = new gson().fromjson(userarray.tostring(), new typetoken<list<map<string, string>>>(){}.gettype()); if (card_list.size() > 5) { recyclerview1.setadapter(new recyclerview1adapter(card_list)); } else { sketchwareutil.showmessage(getapplicationcontext(), "not enough data for recyclerview"); } } catch (jsonexception e) { e.printstacktrace(); sketchwareutil.showmessage(getapplicationcontext(), "error parsing json"); }
The warning is right there, array expected but string found, show your response model for more context. From your json response model class or model data class, users should be an array like below.
For Kotlin
65bee13be98afjava should be:
public class Data{ public ArrayList<User> user; public String next; } public class User{ public String id; public String address; public String contact; public String name; public String description; public String image_url; }
The above is the detailed content of BEGIN_ARRAY but at row 1, column 1 is STRING java android sketchware. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

