开发者

Android Update layout/view

开发者 https://www.devze.com 2023-04-11 21:46 出处:网络
I have a view within a tabgroup, I usually pop unused views off the stack when I go to the next view but in this one particular case I don\'t.

I have a view within a tabgroup, I usually pop unused views off the stack when I go to the next view but in this one particular case I don't.

I want th开发者_如何学运维e original view to update when I finish() the new view, but neither onCreate or any of the lifecycle methods are called is it fully rendered within the tab.

How would I simply update that one individual view. If I called the tab itself, it will show a completely separate and irrelevant view because of the order of the UX

insight appreciated


I find it interesting onResume is never called, I'm guessing the view is always visible while these other actions are happening?

In this case I would probably use a broadcast and set up a receiver in the activity you want to repsond to the change. When something happens you can just send the broadcast.

Here is a pretty basic example: http://www.androidsnippets.com/how-to-set-up-a-broadcastreceiver-intent

You will probably want to register and unregister the listener based you apps lifecycle.

0

精彩评论

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

关注公众号