Used requireArguments instead of getArguments
(cherry picked from commit 203d1ac74c)
This commit is contained in:
parent
4f62904a03
commit
dbd780e688
1 changed files with 2 additions and 8 deletions
|
|
@ -18,7 +18,7 @@ import org.schabi.newpipe.R;
|
||||||
public class ImportConfirmationDialog extends DialogFragment {
|
public class ImportConfirmationDialog extends DialogFragment {
|
||||||
@State
|
@State
|
||||||
protected Intent resultServiceIntent;
|
protected Intent resultServiceIntent;
|
||||||
static final String EXTRA_RESULT_SERVICE_INTENT = "extra_result_service_intent";
|
private static final String EXTRA_RESULT_SERVICE_INTENT = "extra_result_service_intent";
|
||||||
|
|
||||||
public static void show(@NonNull final Fragment fragment,
|
public static void show(@NonNull final Fragment fragment,
|
||||||
@NonNull final Intent resultServiceIntent) {
|
@NonNull final Intent resultServiceIntent) {
|
||||||
|
|
@ -49,13 +49,7 @@ public class ImportConfirmationDialog extends DialogFragment {
|
||||||
public void onCreate(@Nullable final Bundle savedInstanceState) {
|
public void onCreate(@Nullable final Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
if (getArguments() != null) {
|
resultServiceIntent = requireArguments().getParcelable(EXTRA_RESULT_SERVICE_INTENT);
|
||||||
resultServiceIntent = getArguments().getParcelable(EXTRA_RESULT_SERVICE_INTENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (resultServiceIntent == null) {
|
|
||||||
throw new IllegalStateException("Result intent is null");
|
|
||||||
}
|
|
||||||
|
|
||||||
Bridge.restoreInstanceState(this, savedInstanceState);
|
Bridge.restoreInstanceState(this, savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue