2016-10-01 113 views

回答

1

嗨改变你GSON到

{ 
    "Id": "100500", 
    "products": [ 

     { 
     "id": 1, 
     "title": "title 1" 
     }, 
     { 
     "id": 2, 
     "title": "title 2" 
     }, 
     { 
     "id": 3, 
      "title": "title 3" 
     } 

    ] 
} 
1

不,它会解析

public class Store { 
     public long id; 
     public List<Product> products; 

} 

Gson mGson= new Gson(); 
storeList=mGson.fromJson(json, Store.class); 
storeList.getStores().get(0).getProducts().get(1);