avoid concurrent button press crash in TimeListEdit
This commit is contained in:
parent
ddb6e1c007
commit
4c25272969
1 changed files with 9 additions and 7 deletions
|
@ -372,11 +372,13 @@ public class TimeListEdit {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addItem(int index, int timeAsSeconds, double value1, double value2) {
|
private void addItem(int index, int timeAsSeconds, double value1, double value2) {
|
||||||
|
synchronized (this) {
|
||||||
if (itemsCount() > inflatedUntil) {
|
if (itemsCount() > inflatedUntil) {
|
||||||
layout.removeView(finalAdd);
|
layout.removeView(finalAdd);
|
||||||
inflateRow(++inflatedUntil);
|
inflateRow(++inflatedUntil);
|
||||||
layout.addView(finalAdd);
|
layout.addView(finalAdd);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
// shift data
|
// shift data
|
||||||
for (int i = data1.length(); i > index; i--) {
|
for (int i = data1.length(); i > index; i--) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue