开发者

Is there a way to use a game loop or Refresh a Linear Layout within a different class?

My app i'm currently developing needs to refresh a Linear Layout that i'm dynamically adding Views too. I currently am adding all of the Views within the UI thread but have a separate Dialog class which upon a button click within the Dialog will need to refresh/Re draw the Linear Layout. Is there a way I can ref开发者_高级运维resh the Linear Layout within a different class (trying to stay very object oriented in my program design) or a way to use a game loop for a Linear Layout to refresh the View every 3 seconds? Thanks!


I'm pretty sure you don't need to manually "redraw" anything. As soon as you change the contents of your layout (and as soon as android can get around to it (which will be a LOT faster than 3 seconds)) you'll see the updated screen. As to what thread you do this from, you can only change your layouts from the main thread, as far as I know, but you can call Runnable methods in that thread via a handler from anywhere.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜