我会尽量解释一个简单的应用场景:我的应用程序顺利,到主视图。在这个主视图我已经插入了一个的TextView
这显示了 preferenceManager
的方式建立的当前设置。为了简单起见,假设我有我的设置框。当我第一次开始我的应用程序 - 的的TextView
在我的主视图显示了我的复选框,设置正确(真)。现在我去设置菜单,它会弹出式,然后我将其更改为错误的。我回到主视图,看到没有变化。它仍然说是真的,即使我把它改成错误的。如果我最终的应用程序,然后重新启动 - 一切都很好,这显示了我的变化
I will try to explain a simple app scenario: My app goes right to a 'main view'. In this main view I have inserted a TextView
which displays current settings created by way of the PreferenceManager
. For simplicity sake, let's say I have a checkbox in my settings. When I first start my app - the TextView
on my main view shows my checkbox setting correctly (true). Now I go to the settings menu, it pops-up, and then I change it to false. I go back to the main view and see no change. It still say's true even after I changed it to false. If I end the app and then re-start it - all is well and it shows my change.
显然,主视图只是停留在后台,而我改变设置?我如何重绘或更新主视图后,我更改设置?
Apparently the main view just stays in the background while I'm changing settings? How can I redraw or update the main view after I change settings?
当你进入你的preferences您当前的活动应该暂停,当你回去(见的