diff options
author | Jeffrey Sharkey <> | 2009-03-24 18:11:49 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-24 18:11:49 -0700 |
commit | d18299f1d84afb60fdf7bb5d8e31fa17bb70bb79 (patch) | |
tree | caaead44e336ae0f5b75fc4f64926a48c1fd56c7 | |
parent | 9b141a29ba556452f97ecb96fc3014982388c44d (diff) | |
download | packages_apps_trebuchet-d18299f1d84afb60fdf7bb5d8e31fa17bb70bb79.zip packages_apps_trebuchet-d18299f1d84afb60fdf7bb5d8e31fa17bb70bb79.tar.gz packages_apps_trebuchet-d18299f1d84afb60fdf7bb5d8e31fa17bb70bb79.tar.bz2 |
Automated import from //branches/donutburger/...@140670,140670
-rw-r--r-- | src/com/android/launcher/Launcher.java | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/src/com/android/launcher/Launcher.java b/src/com/android/launcher/Launcher.java index 0346b22..2057032 100644 --- a/src/com/android/launcher/Launcher.java +++ b/src/com/android/launcher/Launcher.java @@ -1350,25 +1350,27 @@ public final class Launcher extends Activity implements View.OnClickListener, On private void bindAppWidgets(Launcher.DesktopBinder binder, LinkedList<LauncherAppWidgetInfo> appWidgets) { - + final Workspace workspace = mWorkspace; final boolean desktopLocked = mDesktopLocked; - final LauncherAppWidgetInfo item = appWidgets.removeFirst(); - - final int appWidgetId = item.appWidgetId; - final AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager.getAppWidgetInfo(appWidgetId); - item.hostView = mAppWidgetHost.createView(this, appWidgetId, appWidgetInfo); - - if (LOGD) d(LOG_TAG, String.format("about to setAppWidget for id=%d, info=%s", appWidgetId, appWidgetInfo)); - - item.hostView.setAppWidget(appWidgetId, appWidgetInfo); - item.hostView.setTag(item); - - workspace.addInScreen(item.hostView, item.screen, item.cellX, - item.cellY, item.spanX, item.spanY, !desktopLocked); - - workspace.requestLayout(); + if (!appWidgets.isEmpty()) { + final LauncherAppWidgetInfo item = appWidgets.removeFirst(); + + final int appWidgetId = item.appWidgetId; + final AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager.getAppWidgetInfo(appWidgetId); + item.hostView = mAppWidgetHost.createView(this, appWidgetId, appWidgetInfo); + + if (LOGD) d(LOG_TAG, String.format("about to setAppWidget for id=%d, info=%s", appWidgetId, appWidgetInfo)); + + item.hostView.setAppWidget(appWidgetId, appWidgetInfo); + item.hostView.setTag(item); + + workspace.addInScreen(item.hostView, item.screen, item.cellX, + item.cellY, item.spanX, item.spanY, !desktopLocked); + + workspace.requestLayout(); + } if (appWidgets.isEmpty()) { if (PROFILE_ROTATE) { |