Skip to content

Commit

Permalink
Force preference screen to use our preference stored in DE
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Feb 4, 2019
1 parent 81a0cdd commit 9ab3143
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.WindowManager;
import android.widget.Toast;

Expand Down Expand Up @@ -145,4 +147,11 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permis
public interface ActivityResultListener {
void onActivityResult(int requestCode, int resultCode, Intent data);
}

@Override
public SharedPreferences getSharedPreferences(String name, int mode) {
if (TextUtils.equals(name, getPackageName() + "_preferences"))
return app.prefs;
return super.getSharedPreferences(name, mode);
}
}

0 comments on commit 9ab3143

Please sign in to comment.