Merge "Fix NPE in AppListPreference when there is no default."

This commit is contained in:
Jeff Davidson
2014-04-26 18:44:35 +00:00
committed by Android (Google) Code Review

View File

@@ -94,7 +94,8 @@ public class AppListPreference extends ListPreference {
if (appInfo != null) {
applicationNames[index] = appInfo.loadLabel(pm);
mEntryDrawables[index] = appInfo.loadIcon(pm);
if (appInfo.packageName.contentEquals(defaultPackageName)) {
if (defaultPackageName != null &&
appInfo.packageName.contentEquals(defaultPackageName)) {
selectedIndex = index;
}
index++;