Fixing crash when getActivity is null

> Also changing the default value of preferences to true

Change-Id: I0a80d9b6b76d7210b12c952cf8e991a3eb327e5c
This commit is contained in:
Sunny Goyal
2016-05-02 12:50:34 -07:00
parent 745bad9da1
commit 5ae82081c1
@@ -77,8 +77,8 @@ public class SettingsActivity extends Activity {
@Override
protected Boolean doInBackground(Void... params) {
Bundle extras = new Bundle();
extras.putBoolean(LauncherSettings.Settings.EXTRA_DEFAULT_VALUE, false);
Bundle value = getActivity().getContentResolver().call(
extras.putBoolean(LauncherSettings.Settings.EXTRA_DEFAULT_VALUE, true);
Bundle value = pref.getContext().getContentResolver().call(
LauncherSettings.Settings.CONTENT_URI,
LauncherSettings.Settings.METHOD_GET_BOOLEAN,
pref.getKey(), extras);