Meine Antwort darauf ist,com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Erwartete BEGIN_ARRAY aber war STRING in Zeile 2 Spalte 1 Pfad
[
{
"category_name":"Vaporizers",
"categoryid":"3",
"status":"1",
"description":"<div class= bennar_out_div >\r\n<div class= container >\r\n<div class= viporizers_text >\r\n<div class= viporizers_text_left >\r\n<div class= viporizers_head >Vaporizers</div>\r\n<div class= viporizers_text1 >Whether you’re looking for a portable or a desktop, GroovyVapes offers a wide variety of the highest quality vaporizers available. Every vaporizer that is part of the GroovyVapes lineup is thoroughly evaluated and tested and reviewed by our team to ensure its quality, design, and user-satisfaction.</div>\r\n</div>\r\n<div class= viporizers_text_right >FREE SHIPPING <span>over </span>£85.00<br />NEWEST MODELS<br />PRIVATE & SECURE</div>\r\n</div>\r\n</div>\r\n</div>\r\n<div style= clear: both; > </div>",
"image":false,
"count":0,
"subcategory_name":[
{
"sub_category_name":"Portable",
"sub_categoryid":"10",
"status":"1",
"description":"<div class= bennar_out_div >\r\n<div class= container >\r\n<div class= viporizers_text >\r\n<div class= viporizers_text_left >\r\n<div class= viporizers_head >PORTABLE</div>\r\n<div class= viporizers_text1 >Portable Vaporizers are best used for vaping on the go. Most portable vaporizers are battery powered, with many being easily chargeable via USB.</div>\r\n</div>\r\n<div class= viporizers_text_right >FREE SHIPPING <span>over </span>£85.00<br />NEWEST MODELS<br />PRIVATE & SECURE</div>\r\n</div>\r\n</div>\r\n</div>\r\n<div style= clear: both; > </div>",
"image":"http://www.groovyvapes.co.uk/media/catalog/category/portable.png",
"count":26
}}
]
MyCode:
ArrayList<BrandAccessoriesResponseModel> mBrandAccessoriesResponseModelArrayList = new ArrayList<BrandAccessoriesResponseModel>();
Gson gson = new Gson();
Type listType = new TypeToken<List<BrandAccessoriesResponseModel>>() {}.getType();
mBrandAccessoriesResponseModelArrayList = gson.fromJson(result.toString(), listType);
Mögliche Duplikat [Gson erwartet BEGIN \ _ARRAY b ut war STRING in Zeile 1 Spalte 62] (http://stackoverflow.com/questions/16380367/gson-expected-begin-array-but-was-string-at-line-1-column-62) – Bharatesh