APIDemos 8 PersistenceState,持久文本“保存”在哪里?
在 PersistentState.java 类中,prefs 变量从先前会话中的第 106 行获取保存/键入的文本到 returnedText 中。 getString 方法从哪里获取保存/输入的文本?
protected void onResume() {
super.onResume();
...
SharedPreferences prefs = getPreferences(0);
String restoredText = prefs.getString("text", null);
In the class PersistentState.java the prefs variable gets the saved/typed text from prior sessions here, on line 106 into restoredText. Where does the getString method get the saved/typed text?
protected void onResume() {
super.onResume();
...
SharedPreferences prefs = getPreferences(0);
String restoredText = prefs.getString("text", null);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它将是数据目录中的一个首选项文件,
类似于
it will be a prefs file in the data directory
something like