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