diff options
Diffstat (limited to 'eclipse')
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java index 4a7a002..b5cee81 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java @@ -177,6 +177,8 @@ public class AdtPlugin extends AbstractUIPlugin { private ArrayList<ITargetChangeListener> mTargetChangeListeners = new ArrayList<ITargetChangeListener>(); + protected boolean mSdkIsLoading; + /** * Custom PrintStream for Dx output. This class overrides the method * <code>println()</code> and adds the standard output tag with the @@ -1010,7 +1012,15 @@ public class AdtPlugin extends AbstractUIPlugin { @SuppressWarnings("unchecked") @Override protected IStatus run(IProgressMonitor monitor) { - try { + try { + + if (mSdkIsLoading) { + return new Status(IStatus.WARNING, PLUGIN_ID, + "An Android SDK is already being loaded. Please try again later."); + } + + mSdkIsLoading = true; + SubMonitor progress = SubMonitor.convert(monitor, "Initialize SDK Manager", 100); @@ -1093,6 +1103,7 @@ public class AdtPlugin extends AbstractUIPlugin { } }); } finally { + mSdkIsLoading = false; if (monitor != null) { monitor.done(); } |