[英]How to store and retrieve last used session of an Activity in Android Application
The android application having a toolbar with three buttons of three different implementations. android应用程序具有一个工具栏,该工具栏具有三个按钮,分别具有三种不同的实现方式。 The toolbar is common for all the activities. 该工具栏对于所有活动都是通用的。 while for single click, these toolbars, should display their last used session/Activity and for double click they should display their initial or default states. 对于单击,这些工具栏应显示其上次使用的会话/活动,对于双击,应显示其初始或默认状态。 Can anyone help me with samplecode/links on how to store and retrieve last used session of an activity in android. 任何人都可以通过示例代码/链接帮助我,了解如何在android中存储和检索活动的上次使用会话。
for persistent storage of screen , store requiered data as SharedPreference
/ File
/ SQLite
. 对于屏幕的持久存储,将所需的数据存储为SharedPreference
/ File
/ SQLite
。 for cache or runTime storage use onRestoreInstanceState(Bundle savedInstanceState)
用于缓存或运行时存储,请使用onRestoreInstanceState(Bundle savedInstanceState)
for default values , you can store these values in res/values and set them as hint/text whenever required . 对于默认值,您可以将这些值存储在res / values中,并在需要时将其设置为提示/文本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.