android - 如何防止在recyclerView中解析相同的日期编号
问题描述
在 json 中有很多相同的日期我想每天只取一个日期,比如 nov-11、nov-12、nov-13,所以我可以每天而不是每小时获取他们的数据并在 recyclerView 中解析它
@Override
public void onBindViewHolder(@NonNull WeatherViewHolder holder, int position) {
String a = forecasts.get(position).dt_txt;
String aa= a.substring(5,10);
String b= Math.round(forecasts.get(position).getMain().temp) + "°C";
holder.hourlyTxt.setText(aa);
holder.hourlyTemp.setText(b);
Picasso.get().
load(String.format("http://openweathermap.org/img/w/%s.png", forecasts.get(position).getWeatherList().get(0).icon))
.into(holder.icon);
}
解决方案
推荐阅读
- node.js - 双淘汰,再见玩家场景
- regex - 如何通过正则表达式获取VBScript中两个字符串之间的字符串?
- sql - 如何根据一行中的值使一个标识符的所有值都相同?
- angular - Angular Tabs - 仅使用一个组件
- javascript - TypeError ERR_UNESCAPED_CHARACTERS 使用 Nightwatch 测试 Vue 项目
- spring-boot - 在 Java Spring Boot 中使用多个 MQ 服务器
- python - 如何使两个列表之间的元素比较更有效?(TF-IDF)
- r - 使 scale_colour_manual 为我在 R 中的 ggplot2 上的多因素条形图工作的问题
- excel - 使用 VBA 在 Excel 中输入数据后锁定单元格
- reactjs - 是否有任何网站可以帮助从头开始开发 Web 应用程序?