Lazily instantiate LauncherAppState.
The application context for LauncherAppState is supplied by
the application whenever it starts; don't ask for an
instance before that.
Change-Id: I1ca8ea04238a357a682f79250f08813ead7ae532
diff --git a/src/com/android/launcher3/LauncherProvider.java b/src/com/android/launcher3/LauncherProvider.java
index 91e58e2..ae227a9 100644
--- a/src/com/android/launcher3/LauncherProvider.java
+++ b/src/com/android/launcher3/LauncherProvider.java
@@ -49,7 +49,6 @@
import android.util.Log;
import android.util.Xml;
-import com.android.launcher3.R;
import com.android.launcher3.LauncherSettings.Favorites;
import org.xmlpull.v1.XmlPullParser;
@@ -95,8 +94,9 @@
@Override
public boolean onCreate() {
- mOpenHelper = new DatabaseHelper(getContext());
- LauncherAppState.getInstance().setLauncherProvider(this);
+ final Context context = getContext();
+ mOpenHelper = new DatabaseHelper(context);
+ LauncherAppState.setLauncherProvider(this);
return true;
}