7.2.5. 字符串资源
7.2.5.字符串资源
更新后的strings.xml大致如下:
例 7.5. res/values/strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Yamba 2</string>
<string name="titleYamba">Yamba 2</string>
<string name="hintText">Please enter your 140-character status</string>
<string name="buttonUpdate">Update</string>
<string name="titleStatus">Status Update</string>
<string name="titlePrefs">Prefs</string>
<string name="titleUsername">Username</string>
<string name="titlePassword">Password</string>
<string name="titleApiRoot">API Root</string>
<string name="summaryUsername">Please enter your username</string>
<string name="summaryPassword">Please enter your password</string>
<string name="summaryApiRoot">URL of Root API for your service</string>
</resources>
到这里,你已经可以查看新的选项界面了。打开程序,在消息界面中选择Menu→Prefs即可,如图7.4. PrefsActivity。不妨尝试更改用户名与密码的设置再重启应用程序,查看选项数据是否依然存在。
图7.4. PrefsActivity