开发者

APIDemos 8 PersistenceState, where is the persistent text "saved?"

开发者 https://www.devze.com 2023-01-08 20:07 出处:网络
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?

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 pr开发者_如何学Goefs = getPreferences(0); 
    String restoredText = prefs.getString("text", null);


it will be a prefs file in the data directory

something like

/data/com.birthdroid/default.prefs
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号