Release notes + fix for graph and angle units

This commit is contained in:
Sergey Solovyev
2013-01-20 18:12:43 +04:00
parent ff3aa4970f
commit 2e5d35afa7
4 changed files with 58 additions and 17 deletions

View File

@@ -3,6 +3,7 @@ package org.solovyev.android.calculator;
import android.app.Activity;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.solovyev.android.AndroidUtils;
/**
* User: serso
@@ -17,15 +18,19 @@ public final class Threads {
public static void tryRunOnUiThread(@Nullable final Activity activity, @NotNull final Runnable runnable) {
if (activity != null && !activity.isFinishing()) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
// some time may pass and activity might be closing
if (!activity.isFinishing()) {
runnable.run();
if (AndroidUtils.isUiThread()) {
runnable.run();
} else {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
// some time may pass and activity might be closing
if (!activity.isFinishing()) {
runnable.run();
}
}
}
});
});
}
}
}
}