public class

 
HandlerThread
extends Thread
 
Class  Overview
Handy class for starting a new thread that has a looper.The looper can than be used to create handler classes.Note that start() mast still not called.
 
Handy class for starting a new thread that has a looper.
//这是一个可以很便捷地获取一个Looper来开启一个新线程的类。(这是一个方便创建新线程并拥有looper的类)
The looper can than be used to create handler classes.
//可以利用这个looper创建一盒Handler类。(也就是带looper的handler)
Note that start() mast still not called.
//注意此时start()方法还没调用。
 
Public Constructor//公共构造器
public HandlerThread(String name)
public HandlerThread(String name,int priority)
parameters //参数
priority The priority to run the thread at.The values supplied must be from Procces and not from java.lang.Thread.
//优先级 这个优先级是运行在线程里的,它的值必须是是进程中支持的而非线程。
 
Public Method
public Looper getLooper()
The method returns the looper associated whit this thread.If this thread not been started or for any reason is Alive() returns false,this method will return null.If this thread has been started,this method will brock until the looper has been initialized.
 
The method returns the looper associated whit this thread.
//这个方法将会返回一个和线程关联的looper。
If this thread not been started or for any reason is isAlive() returns false,this method will return null.
//如果这个线程没被执行或者由于任何原因 isAlive()返回假的时候,这个方法将会返回空。
If this thread has been started,this method will brock until the looper has been initialized.
//如果这个线程已经开始运行了,这个方法将会阻塞除非looper已经被初始化。
 
public int getThreadId()
Retunrs the ind identifier of this thread.See Procces.myPid.
//返回这个线程的标识符,见Procces.myPid。
 
public boolean quit()
Ask the currenty running looper to quit.If this thread has not been started or has finished(that is if getLooper() returns null),then false is returned.Otherwise  the looper is asked quit and true is return.
//呼叫当前正在运行中的looper消息循环退出。如果这个线程没有开始或者线程已经执行完毕(getLooper 将返回空),就返回假。否则将退出消息循环并返回真。
 
public void run()
Calls the run() method of the Runnable object the receiver holds.If no Runnable set,does nothing.
//Runnable 对象调用这个方法...不懂,如果没有对象设置,就不做任何事。

Android英文文档翻译系列(2)——HandlerThread的更多相关文章

  1. Android英文文档翻译系列(1)——AlarmManager

      原文:个人翻译,水平有限,欢迎看官指正.                                                              public class Ala ...

  2. Android英文文档翻译系列(6)——LocalBroadcastManager

    public class LocalBroadcastManager extends Object java.lang.Object    ↳ android.support.v4.content.L ...

  3. Android英文文档翻译系列(5)——VPNService

      API14位于android.net.VpnService 类概述|Class OverviewVpnService is a base class for applications to ext ...

  4. Android英文文档翻译系列(4)——PopupWindow

    public class PopupWindow extends Object //直接继承至Object java.lang.Object ↳ android.widget.PopupWindow  ...

  5. Android英文文档翻译系列(3)——AsyncTask

      AsyncTask——异步任务   个人认为这是翻译比较好的一次.. Class Overview//类概述 AsyncTask enables proper and easy use of th ...

  6. Android开发文档翻译之-Services

    Service是一种能长期在后台运行同一时候不须要与用户进行交互的应用组件.其它组件能够开启service,开启后service能够自行运行及时用户已经切换到其它的应用.此外,组件能够与service ...

  7. Android进阶——多线程系列之Thread、Runnable、Callable、Future、FutureTask

    多线程一直是初学者最抵触的东西,如果你想进阶的话,那必须闯过这道难关,特别是多线程中Thread.Runnable.Callable.Future.FutureTask这几个类往往是初学者容易搞混的. ...

  8. Android提升篇系列:Activity recreate(Activity 重新创建/自我恢复)机制(一)

    注:本文中的recreate是指当内存不足时,Activity被回收,但再次来到此Activity时,系统重新恢复的过程.例如:当Activity A到Activity B时,如果内存不足,A被回收, ...

  9. Android控件系列之RadioButton&RadioGroup(转)

    学习目的: 1.掌握在Android中如何建立RadioGroup和RadioButton 2.掌握RadioGroup的常用属性 3.理解RadioButton和CheckBox的区别 4.掌握Ra ...

随机推荐

  1. 【Unity】状态机的状态改变及其回调

    问:怎么知道状态机发生了改变?即如何得知从一个状态切换到了另一个状态? 答:Unity使用StateMachineBehaviours类来描述状态机的行为,当状态机处于不同的状态时,会触发不同的回调. ...

  2. si4438 与 si4432通讯

    http://www.nicerf.cn/_d275147664.htm http://wenku.baidu.com/view/2109573caf1ffc4ffe47ac8c.html si446 ...

  3. wm8976 codec

    root@phyCORE-AM335x:~ amixer controlsnumid=38,iface=MIXER,name='Headphone Playback Switch'numid=39,i ...

  4. JavaScript 闭包原理分析

    本文转载至 http://www.ruanyifeng.com/blog/2009/08/learning_javascript_closures.html 另一篇很好的资料 http://www.k ...

  5. Win2008 Server系统安装打印服务器与配置

    原文:http://60808.org/thread-20259-1-1.html 视频地址:http://edu.51cto.com/lesson/id-20163.html 本文介绍的是在Win2 ...

  6. JEECG常见问题大全征集

    大家还有什么问题.请跟帖,谢谢支持. .  JEECG常见问题大全征集 1. jeecg没有数据库脚本问题   jeecg不须要数据库脚本,在数据库创建好数据库.项目配置好数据源链接.会自己主动建表. ...

  7. HDU 5289 Assignment(多校2015 RMQ 单调(双端)队列)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5289 Problem Description Tom owns a company and he is ...

  8. ios两视图间托付(delegate)传值

    现有两个视图(ViewController.ViewController1),从ViewController中带參数跳转到ViewController1,在ViewController1选中数据后带有 ...

  9. Framework 7 之 Smart select 选择后自动隐藏

    Framework 7官网地址:Framework 7(英文版) Framework 7(中文版) 给“smart-select”添加属性  data-back-on-select="tru ...

  10. 【转】java基本数据类型vs封装数据类型

    1.基本概念 说java是面向对象的语言是正确的,但是她不纯,基本数据类型就不是对象. 基本数据类型可以大致分为三类:数据型:int.short.long.byte.float.double字符型:c ...