0
[
    [
        {
            "description": "",
            "product": "Apple",
            "quantity": "2"
        },
        {
            "description": "",
            "product": "Apple",
            "quantity": "2"
        },
        {
            "description": "",
            "product": "Apple",
            "quantity": "2"
        }
    ],
    [
        {
            "description": "",
            "product": "banana",
            "quantity": "1"
        },
        {
            "description": "",
            "product": "banana",
            "quantity": "1"
        },
        {
            "description": "",
            "product": "banana",
            "quantity": "1"
        }
    ]
]

This is my class

public class items_list{

    private String product;
    private String quantity;
    private String description;


    public items_list(String product, String quantity, String description) {
        this.product = product;
        this.quantity = quantity;
        this.description = description;
    }
}

This is how my ArrayList look like

ArrayList<ArrayList<items_list>> list = new ArrayList<>();

I am a developing an android app to save a arraylist of object, and I want to store an arraylist of arraylist of object. I have no problem converting it into json file using gson, but I am having difficulty converting it back. Pointers would be appreciated:)

  • Does this answer your question? [How to make a collection of images with in a view in android studio using staggered layout (Or any other suggestion)](https://stackoverflow.com/questions/64607773/how-to-make-a-collection-of-images-with-in-a-view-in-android-studio-using-stagge) – Ahmad Sattout Jul 11 '21 at 10:56
  • You can use libraries like GSON or Moshi to parse JSON into objects. But if you want to do it manually, you'll have to use the JSON classes of Java to make A JSON object/array of your string, then traverse it using a loop, and making your Java object https://stackoverflow.com/questions/10308452/how-to-convert-the-following-json-string-to-java-object – Ahmad Sattout Jul 11 '21 at 10:54

0 Answers0