diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-07-18 18:08:08 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-07-18 18:08:08 +0200 |
commit | dad8d319953c46f60e5e586bf5619b0f72e5a44b (patch) | |
tree | a79dcc927ba0fa5258051d402e42f8b73865e6ae /app/src/main/java | |
parent | 5ad8621d35c361df406254610ac4b2a3f365f4a1 (diff) |
AppListDialogFragment: getArguments is null before onCreate
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/com/wireguard/android/fragment/AppListDialogFragment.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/src/main/java/com/wireguard/android/fragment/AppListDialogFragment.java b/app/src/main/java/com/wireguard/android/fragment/AppListDialogFragment.java index 50de0c39..76a8c97c 100644 --- a/app/src/main/java/com/wireguard/android/fragment/AppListDialogFragment.java +++ b/app/src/main/java/com/wireguard/android/fragment/AppListDialogFragment.java @@ -39,7 +39,7 @@ public class AppListDialogFragment extends DialogFragment { private static final String KEY_EXCLUDED_APPS = "excludedApps"; - private final List<String> currentlyExcludedApps = Arrays.asList(getArguments().getStringArray(KEY_EXCLUDED_APPS)); + private List<String> currentlyExcludedApps; private final ObservableKeyedList<String, ApplicationData> appData = new ObservableKeyedArrayList<>(); public static <T extends Fragment & AppExclusionListener> AppListDialogFragment newInstance(final String[] excludedApps, final T target) { @@ -52,6 +52,13 @@ public class AppListDialogFragment extends DialogFragment { } @Override + public void onCreate(@Nullable final Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + currentlyExcludedApps = Arrays.asList(getArguments().getStringArray(KEY_EXCLUDED_APPS)); + } + + @Override public Dialog onCreateDialog(final Bundle savedInstanceState) { final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity()); alertDialogBuilder.setTitle(R.string.excluded_applications); |