片段数据如何保持不变 [英] How can do fragment data remain as it is
本文介绍了片段数据如何保持不变的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将一个片段交换(更改)到另一个片段,因此输入数据为剩余意味着我在该一个搜索功能中有一个片段。在该用户可以通过搜索输入不同的关键字,但它从一个到另一个片段导航,数据被删除我希望输入的数据保持不变。是否有可能?如果是的话?
How can do i swapping(change) one fragment to another fragment so enter data as remain means i have one fragment in that one search functionality. in that user can entered different keyword by search but it navigate from one to other fragment that data is erased i want that entered data remain as it is. is it possible if yes than how ?
推荐答案
你可以使用Bundle
(或者就此而言是SharedPreferences)。
请参阅: http:// stackoverflow .com / questions / 17252236 / how-to-persist-fragment-data-after-backstack-transactions [ ^ ]
-KR
You can useBundle
(or SharedPreferences for that matter).
See this: http://stackoverflow.com/questions/17252236/how-to-persist-fragment-data-after-backstack-transactions[^]
-KR
这篇关于片段数据如何保持不变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文