So I have 3 different ArrayList`s which I need to sort to update my RecyclerView.
final ArrayList<String> Coin = tinydb.getListString("Coin");
final ArrayList<Double> Day = tinydb.getListDouble("Day");
final ArrayList<Double> Price = tinydb.getListDouble("Price");
I sort my Price list like this: Collections.sort(Price);
Now I want that my other lists to be in the same order as the already sorterd Price list, because they need to be shown in the same row in my RecylcerView.
Id be glad if someone could help me!
Edit:
I changed my design and now have only one objective Arraylist:
final ArrayList<CoinData> mData = new ArrayList<CoinData>();
My CoinData class :
public class CoinData {
private static final String TAG = CoinData.class.getSimpleName();
String symbol = "";
String cap = "";
Double price;
String coinheat = "";
String url = "";
Double hour;
Double day;
public void setCap(String cap) { this.cap = cap; }
public void setSymbol(String symbol) { this.symbol = symbol; }
public void setPrice(Double price) { this.price = price; }
public void setCoinheat(String coinheat) { this.coinheat = coinheat; }
public void setUrl(String url) { this.url = url; }
public void setDay(Double day) { this.day = day; }
public void setHour(Double hour) { this.hour = hour; }
public String getCap() { return this.cap; }
public String getSymbol() { return this.symbol; }
public Double getPrice() { return this.price; }
public String getCoinheat() { return this.coinheat; }
public String getUrl() { return this.url; }
public Double getHour() { return this.hour; }
public Double getDay() { return this.day; }
}