-2
私は専用のPCに自分のuTorrentのダウンロードに関するいくつかのデータを含む "Torrent"クラスを持っているかもしれません。 ArrayList<Torrent> torrents
は毎秒バックグラウンドで更新中です。 したがって、私はRecyclerView.Adapterを既知のパターンのように持っています。ViewHolderのonBindViewHoleder()メソッドのロジックは?
@Override
public void onBindViewHolder(final MyViewHolder holder,int position){
...
// Update ETA textView
holder.tvEta.setText(String.format(Locale.getDefault(),"%d h %d min %d s",torrents.get(position).getEta()/3600,(torrents.get(position).getEta()%3600)/60,torrents.get(position).getEta()%60));
...
}
をしかし、この場合にははを動作していない: 、、私に教えてくださいWHYこのコードは完璧に働いていますか?それはちょうど、スタートの最初の値を更新し、より多くを変更しない:アダプターのライト内部
@Override
public void onBindViewHolder(final MyViewHolder holder,int position){
...
// Update ETA textView
int secs = torrents.get(position).getEta();
int hours = secs/3600;
int minutes = (secs % 3600)/60;
int seconds = secs % 60;
holder.tvEta.setText(Locale.getDefault(), String.format("%d h %d min %d s", hours, minutes, seconds));
...
}
以下のように動作しません。..まだ変わっていない... – rbaloo