Comments (3)
当Activity不在前台的时候,系统可能会回收的时候会调用onSaveInstanceState,这时候再show就会出现这个异常。将show方法里面的commit改为commitAllowingStateLoss应该可以解决。
from android-actionsheet.
@HolenZhou
用Handler延迟执行一个继承自DialogFragment的对话框的显示。显示前按home,就可以出现这个错。
我的解决办法(针对对话框):
`override fun show(manager: FragmentManager?, tag: String?) {
if (manager == null)
return
if (Integer.valueOf(android.os.Build.VERSION.SDK) > Build.VERSION_CODES.JELLY_BEAN) {
if (manager.isDestroyed)
return
}
try {
super.show(manager, tag)
} catch (e: Exception) {
e.printStackTrace()
}
}`
from android-actionsheet.
我试了将commit改为commitAllowingStateLoss,也查过原因应该是当前Activity被回收造成的,但是我无法复现这个crash,不知是不是有什么方法可以复现这个crash呢?因为有其他地方有类似的crash,如果可以复现,我就可以测试是否真正解决,我自己通过更改手机字体大小来模拟内存回收,但也没演示出bug,请大牛指点,非常感谢!
from android-actionsheet.
Related Issues (20)
- Only load one item and cancel HOT 1
- I am getting crash when try to dismiss actionsheet.
- Layout of the dislocation
- Scrolling? HOT 9
- The actionsheet is hided
- 如果使用butterknife 的onClick 注解 setListener还可以设置吗
- getNavBarHeight(Context context) bug HOT 1
- Multiple Actionsheets
- NPE : Attempt to invoke virtual method 'void android.support.v4.app.FragmentManager.popBackStack()' on a null object reference HOT 8
- 4.x上getNavBarHeight有问题 HOT 3
- Scrolling Problem HOT 1
- Text on the buttons are all caps HOT 1
- layout error in Nexus 7 with Android 6.0 HOT 3
- How to include this style in default Action bar menu
- How to use it to Fragment HOT 1
- Using with Activity
- 取消按钮的字体是加粗的怎么不加粗啊?
- 返回键监听
- 在tabbar的其中一个fragment中弹出,不会覆盖tabbar HOT 3
- Back Handling
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-actionsheet.