开发者

Message handlers

开发者 https://www.devze.com 2023-03-22 22:43 出处:网络
I have a thread, initialthread that executes a taskevery n seconds. This is enclosed in activity A.i have a message handler on activity B.

I have a thread, initialthread that executes a task every n seconds. This is enclosed in activity A. i have a message handler on activity B.

mHandler = new Handler(){
public void handleMessage(Message msg)
  {
   //perform task
    executetask();
  }
};

Will this handler excutetask() whenever the initialthread finishes executing?? th开发者_开发技巧anks


It will execute whenever you pass the massage from the initial thread.

I mean whenever you call .sentMessage() from the initial thread.

0

精彩评论

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

关注公众号