本文实例为大家分享了Android九宫格图片展示的具体代码,供大家参考,具体内容如下
1、需要的网络JSON数据
2、数据实现类
package chenglong.activitytest.pengintohospital.entity;
import org.json.JSONException;
import org.json.JSONObject;
/**
*
* 科室
* Created by LICHENGLONG on 2017-10-02.
*/
public class BasSection {
public Integer id;//科室id
public String sectionName;//科室名称
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getSectionName() {
return sectionName;
}
public void setSectionName(String sectionName) {
this.sectionName = sectionName;
}
public BasSection(Integer id, String sectionName){
this.id = id;
this.sectionName = sectionName;
}
public static BasSection sectionData(JSONObject json){
try {
return new BasSection(
json.getInt("id"),
json.getString("sectionName");
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
}
3、创建List集合接收数据
ListlistBasSection = new ArrayList();
4、获取JSON数据
/**
* 获取JSON科室数据
*/
public void findSectionData(){
AsyncHttpClient client = new AsyncHttpClient();
//你的JSON数据链接地址
client.get(AbAppConfig.DATA_URL + "appGVConsultation/findSectionData", null, new AsyncHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
try {
JSONObject object = new JSONObject(new String(responseBody));//获取json数据
JSONArray jsonArray = object.getJSONArray("obj");//获取数据集名称为obj的数据
Log.d("jsonArray数据输出:", String.valueOf(jsonArray));
for (int i = 0; i
孢子2生物进化中文版(Spores)
孢子2生物进化中文版让我们来做一回疯狂的博士,打造一个属于自
叫我万岁爷九游官方版
叫我万岁爷带你体验当换地点感觉,全新的模拟手游大作让你开始一
梦回凤歌
梦回凤歌手游中你将步入古代的宫廷纷争之中,本想度过美好幸福的
洋果子店rose最新版本
洋果子店最新版是一款十分容易让人垂涎的开店经营类手游。游戏玩
明日大亨最新版
明日大亨手游,一个非常经典有趣的模拟经营类型的商战手游,在游