Merge change 5688 into donut
* changes:
Fixes #1949253. Prevents NPE on startup.
diff --git a/samples/Home/src/com/example/android/home/Home.java b/samples/Home/src/com/example/android/home/Home.java
index 7e94cc3..0d99508 100644
--- a/samples/Home/src/com/example/android/home/Home.java
+++ b/samples/Home/src/com/example/android/home/Home.java
@@ -255,6 +255,12 @@
private void bindFavorites(boolean isLaunching) {
if (!isLaunching || mFavorites == null) {
+ if (mFavorites == null) {
+ mFavorites = new LinkedList<ApplicationInfo>();
+ } else {
+ mFavorites.clear();
+ }
+
FileReader favReader;
// Environment.getRootDirectory() is a fancy way of saying ANDROID_ROOT or "/system".
@@ -266,12 +272,6 @@
return;
}
- if (mFavorites == null) {
- mFavorites = new LinkedList<ApplicationInfo>();
- } else {
- mFavorites.clear();
- }
-
final Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.addCategory(Intent.CATEGORY_LAUNCHER);