简体   繁体   English

如何在Android应用程序中存储和检索活动的上次使用会话

[英]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.

相关问题 如何在会话中存储userid并在android中检索另一个类? - How To Store userid in session and retrieve it another class in android? Android 如何在“强制停止”应用程序后获取最后的焦点活动 - Android How to get Last Focused Activity after "Force Stop" the Application 在会话中存储Fb用户数据,并在其他活动Android中使用 - Store Fb user data in session and use in another activity android 在Web应用程序中的何处以及如何存储和检索图像? - Where and How to store and Retrieve Images in Web Application? Android-如何从活动ID检索PID? - Android - how to retrieve a PID from an activity ID? 如何在Android中从SD卡检索最后一张图片? - How to retrieve the last image from an SDcard in Android? 如何在GAE中存储和检索(_sh_SESSION)值 - how to store and retrieve (_sh_SESSION) values in GAE 如何在 Android 的 firebase 中存储和检索对象? - How to store and retrieve objects in firebase for Android? Android:如何在sharedpreferences中存储和检索Hashmap数据? - Android:how to store and retrieve Hashmap data in sharedpreferences? 如何通过jdbc检索存储过程中使用的查询 - how to retrieve the queries used in a store procedure through jdbc
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM