avoid concurrent button press crash in TimeListEdit

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

View file

@ -372,11 +372,13 @@ 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);
}
}
try {
// shift data
for (int i = data1.length(); i > index; i--) {