avoid concurrent button press crash in TimeListEdit - now for real

This commit is contained in:
AdrianLxM 2021-01-10 03:54:51 +01:00
parent 4c25272969
commit b509d13073

View file

@ -372,12 +372,11 @@ public class TimeListEdit {
}
private void addItem(int index, int timeAsSeconds, double value1, double value2) {
synchronized (this) {
if (itemsCount() > inflatedUntil) {
layout.removeView(finalAdd);
inflateRow(++inflatedUntil);
layout.addView(finalAdd);
}
if (itemsCount() >= 24) return;
if (itemsCount() > inflatedUntil) {
layout.removeView(finalAdd);
inflateRow(++inflatedUntil);
layout.addView(finalAdd);
}
try {
// shift data