Handle译者署名雪鹰工作室译者链接版本Android2.3r1结构继承.doc

Handle译者署名雪鹰工作室译者链接版本Android2.3r1结构继承.doc

  1. 1、本文档共13页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Handle译者署名雪鹰工作室译者链接版本Android2.3r1结构继承.doc

Handle 译者署名:雪鹰工作室 译者链接: 版本:Android 2.3 r1 结构 继承关系 public class Handle extends Object java.lang.Object android.os.Handler 子类及间接子类 直接子类 AsyncQueryHandler, AsyncQueryHandler.WorkerHandler, HttpAuthHandler, SslErrorHandler 间接子类 是否过期 类概述 A Handler allows you to send and process Message and Runnable objects associated with a threads MessageQueue. Each Handler instance is associated with a single thread and that threads message queue. When you create a new Handler, it is bound to the thread / message queue of the thread that is creating it -- from that point on, it will deliver messages and runnables to that message queue and execute them as they come out of the message queue. Handler 允许你发送和处理消息(Message)并且同一个线程消息队列( HYPERLINK ../../android-sdk_r06-windows/android-sdk-windows/docs/reference/android/os/MessageQueue.htmlMessageQueue)相联系,每个Handler实例是同一个单个的线程和那个线程的消息队列相联系。当你产生一个新的Handler时,它是一定会产生一个和这个Handler相对应的线程和消息队列。它将发现消息并且获消息队列并且执行由发出的消息队列而产产生的结果。 There are two main uses for a Handler: (1) to schedule messages and runnables to be executed as some point in the future; and (2) to enqueue an action to be performed on a different thread than your own. Handler有两个主要的作用: 安排消息和线程在将来的那个时刻和地点来执行。 安排一个动作在不同的线程(除你自己的主线程)中执行。(译者解释:就是程启动时要自动产生一个主线程,你要在这个主线程中加点别的动作,比如你在显示主界面的同时想重启一个线程去请求网络取相应的数据,就可以使用Handle来实现,还比如,一般显示大的图片,在图片未下载下来之前可先显示空的,其它线程启动后,会向网络请求,图片下载完毕后即可告诉主线程已好,再将显示的图片换掉) Scheduling messages is accomplished with the post(Runnable), postAtTime(Runnable, long), postDelayed(Runnable, long), sendEmptyMessage(int), sendMessage(Message), sendMessageAtTime(Message, long), and sendMessageDelayed(Message, long) methods. The post versions allow you to enqueue Runnable objects to be called by the message queue when they are received; the sendMessage versions allow you to enqueue a Message object containing a bundle of data that will be processed by the Handlers handleMessage(Message) method (requiring that you implement a subclass of Handler). 安排信息的任务是由以下方法来完成:post(Runn

您可能关注的文档

文档评论(0)

170****0532 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8015033021000003

1亿VIP精品文档

相关文档