0

I have android AsynTask method that call the Web Service which returns the List<> as shown below:

[[1,"Test",37.334542,-121.890821,-121.890821],
[2,"XYZ",37.337749,-121.886702,-121.886702],
[4,"PQR",37.336453,-121.884985,-121.884985]]

Here my question is how can I convert the response of HttpResponse to List<> as same as shown above.


You may try using jquery plugins such as Nivo Slider. They have nice transition effects and

4

1 に答える 1

2

それはjson応答のように見えます。その場合、その文字列 (jsonResponse) が既にある場合の最も簡単な方法は次のようなものです。

JSONArray json;
try {
    json = new JSONArray (jsonResponse);
} catch (JSONException e) {
    //do something
}

その後、JSONArray をそのまま使用するか、必要に応じて反復処理して各項目を に追加できListます。

于 2012-08-08T07:13:04.783 に答える