Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to parse JSON array without any object in Retrofit?

I am working with Retrofit and GSON. I have a JSON response as a JSON array but I don't know how to parse it by using a model class. My response is as follows:

[
    "One",
    "Two",
    "Three",
    "Four",
    "Five",
    "Six",
    "Seven",
    "Eight"
]
like image 311
Boopathi Avatar asked Feb 20 '15 12:02

Boopathi


1 Answers

Just call in the callback a list of Strings and it should do the job...

new Callback<List<String>>().
like image 89
Vegim Hasani Avatar answered Sep 20 '22 11:09

Vegim Hasani