File tree Expand file tree Collapse file tree
app/src/main/java/org/schabi/newpipe/local/subscription Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818public class ImportConfirmationDialog extends DialogFragment {
1919 @ State
2020 protected Intent resultServiceIntent ;
21+ static final String EXTRA_RESULT_SERVICE_INTENT = "extra_result_service_intent" ;
2122
2223 public static void show (@ NonNull final Fragment fragment ,
2324 @ NonNull final Intent resultServiceIntent ) {
2425 final ImportConfirmationDialog confirmationDialog = new ImportConfirmationDialog ();
25- confirmationDialog .setResultServiceIntent (resultServiceIntent );
26+ final Bundle args = new Bundle ();
27+ args .putParcelable (EXTRA_RESULT_SERVICE_INTENT , resultServiceIntent );
28+ confirmationDialog .setArguments (args );
2629 confirmationDialog .show (fragment .getParentFragmentManager (), null );
2730 }
2831
29- public void setResultServiceIntent (final Intent resultServiceIntent ) {
30- this .resultServiceIntent = resultServiceIntent ;
31- }
32-
3332 @ NonNull
3433 @ Override
3534 public Dialog onCreateDialog (@ Nullable final Bundle savedInstanceState ) {
@@ -50,6 +49,10 @@ public Dialog onCreateDialog(@Nullable final Bundle savedInstanceState) {
5049 public void onCreate (@ Nullable final Bundle savedInstanceState ) {
5150 super .onCreate (savedInstanceState );
5251
52+ if (getArguments () != null ) {
53+ resultServiceIntent = getArguments ().getParcelable (EXTRA_RESULT_SERVICE_INTENT );
54+ }
55+
5356 if (resultServiceIntent == null ) {
5457 throw new IllegalStateException ("Result intent is null" );
5558 }
You can’t perform that action at this time.
0 commit comments