Used requireArguments instead of getArguments

(cherry picked from commit 203d1ac74c)
This commit is contained in:
Siddhesh Dhainje 2026-01-04 21:40:40 +05:30 committed by Tobi
parent 4f62904a03
commit dbd780e688

View file

@ -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);
} }