prevent from dialog fragment crashing

This commit is contained in:
Mariotaku Lee 2017-04-06 20:09:17 +08:00
parent 399494ec5b
commit 101d63acec
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
1 changed files with 5 additions and 5 deletions

View File

@ -201,11 +201,11 @@ class StatusFragment : BaseFragment(), LoaderCallbacks<SingleResponse<Parcelable
removeSpan(dialogSpan)
setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
val activity = activity
if (activity == null || activity.isFinishing) return
MessageDialogFragment.show(activity.supportFragmentManager,
message = getString(R.string.cant_load_all_replies_explanation),
tag = "cant_load_all_replies_explanation")
executeAfterFragmentResumed {
MessageDialogFragment.show(it.childFragmentManager,
message = getString(R.string.cant_load_all_replies_explanation),
tag = "cant_load_all_replies_explanation")
}
}
}, spanStart, spanEnd, Spanned.SPAN_INCLUSIVE_INCLUSIVE)
}