-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Description
public BaseNiceDialog show(FragmentManager manager) {
FragmentTransaction ft = manager.beginTransaction();
if (this.isAdded()) {
ft.remove(this).commit();
}
ft.add(this, String.valueOf(System.currentTimeMillis()));
ft.commitAllowingStateLoss();
return this;
}
09-11 10:41:36.413 5744 5744 E AndroidRuntime: FATAL EXCEPTION: main
09-11 10:41:36.413 5744 5744 E AndroidRuntime: Process: com.noahedu.intelligentguidestudy, PID: 5744
09-11 10:41:36.413 5744 5744 E AndroidRuntime: java.lang.IllegalStateException: Can't change tag of fragment YxpStarLoadDialog{a60c8e0 #7 1568169695869}: was 1568169695869 now 1568169696411
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at android.support.v4.app.BackStackRecord.doAddOp(BackStackRecord.java:393)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at android.support.v4.app.BackStackRecord.add(BackStackRecord.java:363)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at com.othershe.nicedialog.BaseNiceDialog.show(BaseNiceDialog.java:177)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at com.noahedu.youyou.view.widget.wbeview.MyWebView.showLoadDialog(MyWebView.java:588)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at com.noahedu.youyou.view.widget.wbeview.MyWebView$WebClient$2.run(MyWebView.java:518)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at android.app.Activity.runOnUiThread(Activity.java:5969)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at com.noahedu.youyou.view.widget.wbeview.MyWebView$WebClient.onPageStarted(MyWebView.java:515)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at com.android.webview.chromium.WebViewContentsClientAdapter.onPageStarted(WebViewContentsClientAdapter.java:517)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at org.chromium.android_webview.AwContentsClientCallbackHelper$MyHandler.handleMessage(AwContentsClientCallbackHelper.java:144)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:110)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at android.os.Looper.loop(Looper.java:203)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6293)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1084)
09-11 10:41:36.413 5744 5744 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:945)
--------- beginning of system
ft.remove(this).commit();
此方法并不是同步的,当两次show很快的时候,就可能出现这个错。所以可以做下处理,比如换成ft.remove(this).commitNow();
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels