/**
* 获取网络数据
*/
private void getData() {
StringRequest stringRequest = new StringRequest(Request.Method.POST, TEST_API, new Response.Listener<String>() {
@Override
public void onResponse(String s) {
textView.setText("data from Internet: " + s);
try {
JSONObject jsonObject = new JSONObject(s);
JSONArray resultList = jsonObject.getJSONArray("resultList");
JSONObject JSONObject = (org.json.JSONObject) resultList.opt(0);
String head_img = JSONObject.getString("head_img");
ImageLoader.getInstance().displayImage(head_img, imageView);
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError volleyError) {
}
}) {
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String, String> map = new HashMap<String, String>();
map.put("phone", "15962203803");
map.put("password", "123456");
return map;
}
};
queue.add(stringRequest);
}
if (queue.getCache().get(TEST_API) != null) {
String cachedResponse = new String(queue.getCache().get(TEST_API).data);
ImageLoader.getInstance().displayImage(head_img, imageView);
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有