Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我是一个活动,并且我知道另一个活动正在运行,我如何更改另一个活动的按钮文本?
另一个活动正在运行,但它正在运行onPause,你不能保证在你再次回到那里之前活动不会破坏。
onPause
因此,您应该更好地查看onResume更新按钮文本的活动。如果您仍想在活动处于暂停状态时更改按钮文本,您可以在将更改文本的活动上使用广播接收器。您也可以使用处理程序可运行以更新按钮文本。
onResume
更改持久存储中的某些内容,例如共享首选项。
然后在目标活动中,重写 onResume 方法来检查持久存储并在按钮上执行更改。
Hopefully simple java question I've just forgotten or never understood. I've been playing with Loaders in Android 4.0. The program is working as was but now I'm looking to the 'next' part. I want a