Add a new attribute to allow widgets to specify a preview image.

Change-Id: I0d79c85c6a2fc477af17eda05eabaa3151b0bef5
This commit is contained in:
Patrick Dubroy
2010-06-23 14:56:28 -07:00
parent ab3593956c
commit d2db2a5794
5 changed files with 31 additions and 0 deletions

View File

@@ -741,6 +741,9 @@ class AppWidgetService extends IAppWidgetService.Stub
}
info.label = activityInfo.loadLabel(mPackageManager).toString();
info.icon = ri.getIconResource();
info.previewImage = sa.getResourceId(
com.android.internal.R.styleable.AppWidgetProviderInfo_previewImage, 0);
sa.recycle();
} catch (Exception e) {
// Ok to catch Exception here, because anything going wrong because