Add shortcut manager support to Settings (2/2)
b/28298258 Locale change will be handled in future CL/ dynamic shortcut list change using a UI will be handled in follow up CL. Change-Id: I5468b17e8c8b32625139ab0484d5d0386be0961d
This commit is contained in:
@@ -59,14 +59,14 @@ public class CreateShortcut extends LauncherActivity {
|
||||
ResolveInfo resolveInfo = itemForPosition(position).resolveInfo;
|
||||
ActivityInfo activityInfo = resolveInfo.activityInfo;
|
||||
if (activityInfo.icon != 0) {
|
||||
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON, createIcon(activityInfo.icon));
|
||||
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON, createIcon(this, activityInfo.icon));
|
||||
}
|
||||
setResult(RESULT_OK, intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
private Bitmap createIcon(int resource) {
|
||||
Context context = new ContextThemeWrapper(this, android.R.style.Theme_Material);
|
||||
static Bitmap createIcon(Context ctx, int resource) {
|
||||
Context context = new ContextThemeWrapper(ctx, android.R.style.Theme_Material);
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.shortcut_badge, null);
|
||||
((ImageView) view.findViewById(android.R.id.icon)).setImageResource(resource);
|
||||
|
||||
|
Reference in New Issue
Block a user