Adding the activity icon in wallpaper list

Change-Id: Id31e6dfdfd2f214e6686d21f2aeeb68762de5893
This commit is contained in:
Sunny Goyal
2015-11-24 14:09:20 -08:00
parent 03e1bee786
commit bfcf2a9044
2 changed files with 45 additions and 0 deletions

View File

@@ -65,6 +65,7 @@ public class WallpaperTypeSettings extends SettingsPreferenceFragment implements
// Add Preference items for each of the matching activities
for (ResolveInfo info : rList) {
Preference pref = new Preference(getPrefContext());
pref.setLayoutResource(R.layout.preference_wallpaper_type);
Intent prefIntent = new Intent(intent);
prefIntent.setComponent(new ComponentName(
info.activityInfo.packageName, info.activityInfo.name));
@@ -72,6 +73,7 @@ public class WallpaperTypeSettings extends SettingsPreferenceFragment implements
CharSequence label = info.loadLabel(pm);
if (label == null) label = info.activityInfo.packageName;
pref.setTitle(label);
pref.setIcon(info.loadIcon(pm));
parent.addPreference(pref);
}
}