Populating JSON from this link to android Listview

后端 未结 4 1453
余生分开走
余生分开走 2020-12-18 04:58

I am trying to display the elements in listview from the JSON::

JsonURL- https://dl.dropboxusercontent.com/s/rhk01nqlyj5gixl/jsonparsing.txt

4条回答
  •  被撕碎了的回忆
    2020-12-18 05:31

    Use of ArrayList will be better for you.See the following snippet,

    Declare the following on the top,

    public static ArrayList FriendName = new ArrayList();
    

    And the following inside the try block after fetching the Name

    FriendName .add(Name);
    

    And you can easily fetch the values from the arraylist through the index value like follows,

    String data=FriendName.get(0);
    

提交回复
热议问题