diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2019-09-27 17:26:56 +0530 |
---|---|---|
committer | Harsh Shandilya <me@msfjarvis.dev> | 2019-09-27 17:26:56 +0530 |
commit | c545b5e65f99c4cb2249844badaaf14a43a6e8be (patch) | |
tree | 0658f7177a4cd0bbf2c16e020b81d18d117257fc /app/src | |
parent | 992b6486a1bfc76fe2ed1ff614cb36e6a591a0a1 (diff) |
FragmentUtils: Directly cast context as SettingsActivity
ContextThemeWrapper#getContext seems to be an instance of ContextImpl now which
is not public API and also not what we want. Directly cast context as SettingsActivity
which seems to work exactly how we need this to.
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/com/wireguard/android/util/FragmentUtils.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/src/main/java/com/wireguard/android/util/FragmentUtils.java b/app/src/main/java/com/wireguard/android/util/FragmentUtils.java index a3e622b2..5fb9a3bc 100644 --- a/app/src/main/java/com/wireguard/android/util/FragmentUtils.java +++ b/app/src/main/java/com/wireguard/android/util/FragmentUtils.java @@ -18,8 +18,8 @@ public final class FragmentUtils { public static SettingsActivity getPrefActivity(final Preference preference) { final Context context = preference.getContext(); if (context instanceof ContextThemeWrapper) { - if (((ContextThemeWrapper) context).getBaseContext() instanceof SettingsActivity) { - return ((SettingsActivity) ((ContextThemeWrapper) context).getBaseContext()); + if (context instanceof SettingsActivity) { + return ((SettingsActivity) context); } } return null; |