There is a List of Lists of Float values as Json, how is it possible to get List<List<Float>>
?
I tried something like:
class MyLine{
List<Float> values;
}
String firstData = "[[0.11492168, -0.30645782, 9.835381], [0.12449849, -0.29688102, 9.844957]]"
Gson gson = new Gson();
List<MyLine> firstList = gson.fromJson(firstData, new TypeToken<List<MyLine>>(){}.getType());
but I have an error Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 3 path $[0]
. What is wrong with my code?