Volley获取数据
来源:互联网 发布:淘宝装修主页 编辑:程序博客网 时间:2024/06/06 02:54
private void getData() { Log.d("TAG", "getHot()"); String url = "http://api.xxxxxxxxxxxxx"; RequestQueue mQueue = Volley.newRequestQueue(mActivity); // StringRequest stringRequest = new StringRequest(Method.POST, url, // listener, errorListener); StringRequest stringRequest = new StringRequest(Method.POST, url, new Response.Listener<String>() { @Override public void onResponse(String response) { Log.d("TAG", "onResponse"+response); Gson gson = new Gson(); HotInfoBean hotInfoBean = gson.fromJson(response, HotInfoBean.class); Log.d("TAG", "hotInfoBean"+hotInfoBean.toString()); rows = hotInfoBean.getRows(); Log.d("TAG", "rows"+rows.toString()); users = hotInfoBean.getUsers(); Log.d("TAG", "users"+users.toString()); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { Log.e("TAG", "onErrorResponse"+error.getMessage(), error); } }) { @Override protected Map<String, String> getParams() throws AuthFailureError { Map<String, String> map = new HashMap<String, String>(); map.put("uid", "1052471"); map.put("deviceId", "0"); map.put("atoken", "4FiSgMyO3C69cxum"); return map; } }; mQueue.add(stringRequest); Log.d("TAG", "stringRequest = "+stringRequest.toString());}
0 0
- Volley获取数据
- volley获取缓存数据
- volley 获取数据
- Volley获取Json数据异常
- 使用Volley获取服务器数据demo
- 自定义ListView使用Volley获取数据
- Volley 库通过网络获取 JSON 数据
- 用volley从网页获取json数据
- android 使用Volley获取json数据
- volley获取json数据乱码,解决方法
- Volley获取json数据乱码问题
- Volley获取网络数据出现乱码
- volley出现的获取数据异常
- 使用Volley,没网的时候能获取数据吗?
- Volley 重写源码,使用Post方式获取网络Json数据
- Android Volley 库通过网络获取 JSON 数据
- Android Volley 获取磁盘已有缓存数据
- volley源码解析(四)--CacheDispatcher从缓存中获取数据
- 转 navigationBar 的坑
- Android 内存泄漏案例和解析
- spring学习笔记(26)spring整合Quartz2持久化稳健任务调度
- 2016肇庆医疗大会总结
- Android Https服务器端和客户端简单实例
- Volley获取数据
- SpringMVC Resetful+Hibernate+MySQL实现增删改查操作
- linux系统安装yum环境
- 浅析Java中的final关键字
- web项目部署到服务器流程
- the project description file (.project) is out of sync with the file system.
- 深入理解JavaScript系列(三): 作用域链与闭包
- Ubuntu15.10配置redmine
- PHP 删除文件与文件夹操作 unlink()与rmdir()这两个函数的使用