Skip to content

Commit e2633c1

Browse files
author
Othershe
committed
fix bug
1 parent d9552f8 commit e2633c1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ allprojects {
2323
**Step 2. 添加项目依赖**
2424
``` gradle
2525
dependencies {
26-
compile 'com.github.Othershe:NiceDialog:1.1.3'
26+
compile 'com.github.Othershe:NiceDialog:1.1.4'
2727
}
2828
```
2929
**Step 3. 配置、展示dialog**

nicedialog/src/main/java/com/othershe/nicedialog/BaseNiceDialog.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import android.support.annotation.StyleRes;
77
import android.support.v4.app.DialogFragment;
88
import android.support.v4.app.FragmentManager;
9+
import android.support.v4.app.FragmentTransaction;
910
import android.view.Gravity;
1011
import android.view.LayoutInflater;
1112
import android.view.View;
@@ -162,7 +163,12 @@ public BaseNiceDialog setAnimStyle(@StyleRes int animStyle) {
162163
}
163164

164165
public BaseNiceDialog show(FragmentManager manager) {
165-
super.show(manager, String.valueOf(System.currentTimeMillis()));
166+
FragmentTransaction ft = manager.beginTransaction();
167+
if (this.isAdded()) {
168+
ft.remove(this).commit();
169+
}
170+
ft.add(this, String.valueOf(System.currentTimeMillis()));
171+
ft.commitAllowingStateLoss();
166172
return this;
167173
}
168174
}

0 commit comments

Comments
 (0)