Refactoring getPreferenceKey method

This method was returnning a constant and getting inlined by proguard.

Change-Id: I87348e25b21483adc1b27d16f99dec4b73205701
This commit is contained in:
Sunny Goyal
2015-10-19 16:59:07 -07:00
parent 705b4abd57
commit f725824fa2
11 changed files with 33 additions and 65 deletions

View File

@@ -1,13 +1,13 @@
package com.android.launcher3.testing;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.Utilities;
import com.android.launcher3.util.TestingUtils;
public class ToggleWeightWatcher extends Activity {
@@ -16,8 +16,7 @@ public class ToggleWeightWatcher extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String spKey = LauncherAppState.getSharedPreferencesKey();
SharedPreferences sp = getSharedPreferences(spKey, Context.MODE_PRIVATE);
SharedPreferences sp = Utilities.getPrefs(this);
boolean show = sp.getBoolean(TestingUtils.SHOW_WEIGHT_WATCHER, true);
show = !show;