Removed restoreInstanceState and resultServiceIntent condition
This commit is contained in:
parent
a3673f8c3b
commit
418e34172a
@ -10,13 +10,11 @@ import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.evernote.android.state.State;
|
||||
import com.livefront.bridge.Bridge;
|
||||
|
||||
import org.schabi.newpipe.R;
|
||||
|
||||
public class ImportConfirmationDialog extends DialogFragment {
|
||||
@State
|
||||
protected Intent resultServiceIntent;
|
||||
private static final String EXTRA_RESULT_SERVICE_INTENT = "extra_result_service_intent";
|
||||
|
||||
@ -37,9 +35,7 @@ public class ImportConfirmationDialog extends DialogFragment {
|
||||
.setCancelable(true)
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.setPositiveButton(R.string.ok, (dialogInterface, i) -> {
|
||||
if (resultServiceIntent != null && getContext() != null) {
|
||||
getContext().startService(resultServiceIntent);
|
||||
}
|
||||
requireContext().startService(resultServiceIntent);
|
||||
dismiss();
|
||||
})
|
||||
.create();
|
||||
@ -50,8 +46,6 @@ public class ImportConfirmationDialog extends DialogFragment {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
resultServiceIntent = requireArguments().getParcelable(EXTRA_RESULT_SERVICE_INTENT);
|
||||
|
||||
Bridge.restoreInstanceState(this, savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user