-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Perform this commit() action after onSaveInstanceState! #854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
该异常是Fragmentation打印的, 并不会导致崩溃,只是 提示下在StateSaved状态下执行了事务,如果这个事务非常非常重要,需要无论如何都要保存正确性,需要你在此处再进行保存恢复处理
这个是因为库默认绕过了SaveState的检查,但是绕过时会通过下面的方式回调,并打印日志: Fragmentation.builder()
...
.debug(true) // 实际场景建议.debug(BuildConfig.DEBUG)
/**
* 可以获取到{@link me.yokeyword.fragmentation.exception.AfterSaveStateTransactionWarning}
* 在遇到After onSaveInstanceState时,不会抛出异常,会回调到下面的ExceptionHandler
*/
.handleException(new ExceptionHandler() {
@Override
public void onException(Exception e) {
// 以Bugtags为例子: 把捕获到的 Exception 传到 Bugtags 后台。
// Bugtags.sendException(e);
}
})... |
ok,thanks |
那么我是否可以理解类似于以下Log信息的抛出是不会导致APP崩溃的么? java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState |
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState |
这个只是打印了Log
这个是崩溃, #863 不知道你是否也是用了v27.1.1的v4包? 稍后调研下 如果没有副作用的话会考虑兼容 |
是的,我用的是v27.1.1的v4包,那么请问目前应该使用哪个版本的v4包呢? |
ok我先退回27.1.0这个版本 |
v1.3.4兼容了该问题 |
Issues Guideline
Following information can help us to resolve the issue faster.
In addition, we do not accept issues unrelated to Fragmentation.
me.yokeyword.fragmentation.exception.AfterSaveStateTransactionWarning: Warning: Perform this commit() action after onSaveInstanceState!
at me.yokeyword.fragmentation.TransactionDelegate.handleAfterSaveInStateTransactionException(TransactionDelegate.java:713)
at me.yokeyword.fragmentation.TransactionDelegate.supportCommit(TransactionDelegate.java:493)
at me.yokeyword.fragmentation.TransactionDelegate.start(TransactionDelegate.java:455)
at me.yokeyword.fragmentation.TransactionDelegate.doDispatchStartTransaction(TransactionDelegate.java:385)
at me.yokeyword.fragmentation.TransactionDelegate.access$400(TransactionDelegate.java:32)
at me.yokeyword.fragmentation.TransactionDelegate$4.run(TransactionDelegate.java:132)
at me.yokeyword.fragmentation.queue.ActionQueue.handleAction(ActionQueue.java:53)
at me.yokeyword.fragmentation.queue.ActionQueue.enqueueAction(ActionQueue.java:45)
at me.yokeyword.fragmentation.queue.ActionQueue.access$000(ActionQueue.java:17)
at me.yokeyword.fragmentation.queue.ActionQueue$1.run(ActionQueue.java:37)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:177)
at com.trainor.hsehome.base.CatchCrash$setCrashHandler$1.run(CatchCrash.kt:24)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:177)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
很奇怪,我看到wiki的1.3.x版本的说明上说不会再出现after onSaveInstanceState! 但是后台的日志管理又看到了几条这样的log信息
The text was updated successfully, but these errors were encountered: