diff --git a/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java b/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java index 4a7a002e2..b5cee81b5 100644 --- a/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java +++ b/tools/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 mTargetChangeListeners = new ArrayList(); + protected boolean mSdkIsLoading; + /** * Custom PrintStream for Dx output. This class overrides the method * println() 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(); }