mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-31 01:51:24 +01:00
Simplification, dialog fragment for quick setup
This commit is contained in:
27
app/src/main/java/eu/faircode/email/DialogFragmentEx.java
Normal file
27
app/src/main/java/eu/faircode/email/DialogFragmentEx.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package eu.faircode.email;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import static android.app.Activity.RESULT_CANCELED;
|
||||
|
||||
public class DialogFragmentEx extends DialogFragment {
|
||||
@Override
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
super.onDismiss(dialog);
|
||||
sendResult(RESULT_CANCELED);
|
||||
}
|
||||
|
||||
protected void sendResult(int result) {
|
||||
Fragment target = getTargetFragment();
|
||||
if (target != null) {
|
||||
Intent data = new Intent();
|
||||
data.putExtra("args", getArguments());
|
||||
target.onActivityResult(getTargetRequestCode(), result, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user