Fix #74
This commit is contained in:
@@ -7,6 +7,7 @@ import android.os.Bundle
|
||||
import android.os.Parcelable
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.app.AppCompatDialogFragment
|
||||
import androidx.fragment.app.Fragment
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
|
||||
/**
|
||||
@@ -38,6 +39,11 @@ abstract class AlertDialogFragment<Arg : Parcelable, Ret : Parcelable> :
|
||||
super.onDismiss(dialog)
|
||||
targetFragment?.onActivityResult(targetRequestCode, Activity.RESULT_CANCELED, null)
|
||||
}
|
||||
|
||||
fun show(target: Fragment, requestCode: Int = 0, tag: String = javaClass.simpleName) {
|
||||
setTargetFragment(target, requestCode)
|
||||
show(target.fragmentManager ?: return, tag)
|
||||
}
|
||||
}
|
||||
|
||||
@Parcelize
|
||||
|
||||
Reference in New Issue
Block a user