- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话: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
您可能关注的文档
- 2013年广西联通BSS系统Oracle数据库及中间件优化项目资格.docx
- 2013年度桂城路边停车标线标牌建设及维护工程(第二次).doc
- EOS工作流稳定性测试.doc
- ePass2000AutoUSBKEY使用手册ePass2000Auto是一款能够自动.doc
- Erlang进程模型在C++中的实践.pps.ppt
- 2013版土木工程专业教学大纲.doc
- 2014全国教学APP市集暨教学应用趣、教学微影片征选活动.doc
- 2014年办公设备、信息系统运行维护项目监理.doc
- eTax@SH电脑开票单机版-神计信息.doc
- 2014年度干部基础理论知识考试试题(六).doc
- 2025年AI药物商业化收益预测报告.docx
- 2025年智慧能源微电网分布式电源成本报告.docx
- 跨境电商平台2025年绿色物流体验旅程优化设计报告.docx
- 2025年低空经济「AI自主导航」无人机在智慧农业中的应用报告.docx
- 2024-2025学年黑龙江省佳木斯市同江市八年级(下)期末物理试卷(含答案).pdf
- 2025年风电叶片涂层技术进展与应用分析报告.docx
- 2025年无人机低空医疗通信保障场景分析报告.docx
- 临清辅警考试题库及答案.doc
- 低空经济2025年「人机协同」安全规范与培训体系技术突破报告.docx
- 2025年新能源汽车车路协同通信网络在车联网产业生态中的应用报告.docx
原创力文档


文档评论(0)