Skip to content

Commit

Permalink
#update dialog取消方法健壮性
Browse files Browse the repository at this point in the history
  • Loading branch information
wumeng1 authored and wumeng1 committed Oct 9, 2021
1 parent 2b2545d commit 0270792
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ protected void onCreateDelegate(@Nullable Bundle savedInstanceState) {
initStatusBar();
bindContentView();
bindMediator();
initialize(savedInstanceState);
initialize();
}

protected void initialize(@Nullable Bundle savedInstanceState) {
}

/*** 绑定布局 */
protected void bindContentView() {
setContentView(getLayoutId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public BaseDialog showAllowingStateLoss(FragmentManager manager, String tag) {
Field mShownByMe = DialogFragment.class.getDeclaredField("mShownByMe");
mShownByMe.setAccessible(true);
mShownByMe.set(this, true);
} catch (Exception e) {
} catch (Throwable e) {
}
FragmentTransaction ft = manager.beginTransaction();
ft.add(this, tag);
Expand All @@ -265,6 +265,13 @@ public BaseDialog showAllowingStateLoss(FragmentManager manager) {
return showAllowingStateLoss(manager, getClass().getName());
}

@Override
public void dismissAllowingStateLoss() {
try {
super.dismissAllowingStateLoss();
} catch (Throwable e) {
}
}

protected void convertView(ViewHolder viewHolder, BaseDialog baseDialog) {

Expand Down

0 comments on commit 0270792

Please sign in to comment.