图片素材网站免费大推荐网站正在备案
news/
2025/10/8 21:32:04/
文章来源:
图片素材网站免费大推荐,网站正在备案,网站开发源代码,卧室室内装修设计网站我想在recyclerview中显示一些JSON对象#xff0c;并且希望它们在日期之后排序#xff0c;我该如何实现#xff1f;下面是下载从JSON URL的数据的方法#xff1a;Android Studio Studio回收列表中的JSON对象public void downloadFromSkistar(){try{URL url new URL(…我想在recyclerview中显示一些JSON对象并且希望它们在日期之后排序我该如何实现下面是下载从JSON URL的数据的方法Android Studio Studio回收列表中的JSON对象public void downloadFromSkistar(){try{URL url new URL(XXXXX);HttpURLConnection conn (HttpURLConnection) url.openConnection();conn.setReadTimeout(10000 /* milliseconds */);conn.setConnectTimeout(15000 /* milliseconds */);conn.setRequestMethod(GET);// Starts the queryconn.connect();int response conn.getResponseCode();Log.i(AndroidExample, Response: response);if (response 200){String json getJson(conn.getInputStream());JSONObject jsonObject new JSONObject(json);JSONArray jsonArray jsonObject.getJSONArray(rideStatistics);int reponame 0;for (int i 0; i jsonArray.length(); i){JSONObject skiRun jsonArray.getJSONObject(i);reponame skiRun.getInt(height);}final int height reponame;final int count jsonArray.length();new Handler(Looper.getMainLooper()).post(new Runnable() {Overridepublic void run() {dropHeight.set( height);rideCount.set( count);}});}}catch (Exception e){Log.i(AndroidExample, Error);}finally{}}我不知道我是否能提供足够的信息因为我很新的这一点基本上是我想要的是显示JSON对象内我的回收查看列表与最新日期第一等对象0您需要创建循环视图自定义适配器接受JSON对象和显示 –0可能重复http://stackoverflow.com/questions/32562107/how -to-排序的数据功能于recyclerview –
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/931963.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!