diff options
| author | Romain Guy <romainguy@android.com> | 2009-06-29 14:55:08 -0700 |
|---|---|---|
| committer | Romain Guy <romainguy@android.com> | 2009-06-29 14:55:08 -0700 |
| commit | 14035e86346570a3b323fd0cb996c74f0c8deeb3 (patch) | |
| tree | 13005d77d1307c61c2f9061a77472f81276943f8 /samples/Home | |
| parent | 14b3c0c9a440016b996c485b820f1bd57bd63695 (diff) | |
| download | android_development-14035e86346570a3b323fd0cb996c74f0c8deeb3.tar.gz android_development-14035e86346570a3b323fd0cb996c74f0c8deeb3.tar.bz2 android_development-14035e86346570a3b323fd0cb996c74f0c8deeb3.zip | |
Fixes #1949253. Prevents NPE on startup.
Diffstat (limited to 'samples/Home')
| -rw-r--r-- | samples/Home/src/com/example/android/home/Home.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/samples/Home/src/com/example/android/home/Home.java b/samples/Home/src/com/example/android/home/Home.java index 7e94cc388..0d9950857 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 @@ public class Home extends Activity { 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 @@ public class Home extends Activity { 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); |
