它是一个很好的做法,用户Fragment.setRetainInstance不处理消遣? [英] Is it a good practice to user Fragment.setRetainInstance to not handle recreation?

查看:119
本文介绍了它是一个很好的做法,用户Fragment.setRetainInstance不处理消遣?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它是一个很好的做法,使用 Fragment.setRetainInstance()您所有的片段,以获取摆脱自己的处理片段游憩,节能实例各州,等等?为什么不呢?

Is it a good practice to use Fragment.setRetainInstance() for all of your Fragments in order to get rid yourself of handling Fragments recreation, saving instances states, etc? Why not?

推荐答案

是的,你可以不回堆栈段使用它,如果他们要保留配置更改。它只是使事情变得更简单。

Yes, you can use it with fragments not in the back stack if they have to retain configuration changes. It just make things simpler.

另请参阅 http://stackoverflow.com/a/8550351/1300995

这篇关于它是一个很好的做法,用户Fragment.setRetainInstance不处理消遣?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆