有没有办法做到这一点?举例来说,我在我的preferences可度量和测量的标准单位,当用户改变这一点,我想更新一些字符串在我的应用程序,改变周围的一些标签之间转换的设置。
Is there a way to do this? For instance, I have a setting in my preferences that can convert between metric and standard units of measurement and when the user changes this I would like to update a few strings to change some labels around within my app.
您可以在TextView中或任何类似的更新标签。
You can update the label on TextView or anything similar.
使用获取更新后的字符串 update_str = Context.getResources()的getString(R.string.update_identifier)
使用更新标签((TextView中)findViewById(R.id.textview))。的setText(updated_str)
Get the updated string using update_str = Context.getResources().getString (R.string.update_identifier)
Update the label using ((TextView)findViewById (R.id.textview)).setText (updated_str)
上一篇:AudioTrack流模式MODE_STREAMING模式、AudioTrack、MODE_STREAMING
下一篇:的preferences使用preferenceActivity时,令人耳目一新的观点耳目、观点、preferences、preferenceActivity