Parse JSON data and put them into a gridview

风格不统一 提交于 2019-12-04 15:54:14

You save the JSON data in some array and then

gridView.setAdapter(new ImageAdapter(this, MOBILE_OS));

Refer to this link for Gridview with custom adapter

http://www.mkyong.com/android/android-gridview-example/

After parsing the JSON data store the data in a collection (an ArrayList will do), create an adapter and bind it with your GridView using setAdapter method of the grid view

Check the developer docs

Using

import org.json.JSONArray;
import org.json.JSONObject;

Can do easily. Check the reference Android gridview using json data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!