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. 【工具】小巧好用的屏幕截图工具——ScrToPic

    百度搜ScrToPic,有绿色版的用. 好处: 小巧快捷,不用为了截图而开QQ,不用看QQ的弹窗广告. 可以自定义截图区域和窗口捕捉,可以自定义这两个功能的快捷键. 截图时可以选择要不要显示鼠标. 窗 ...

  2. C语言 · 学生信息(P1102)

    算法训练 P1102   时间限制:1.0s   内存限制:256.0MB      定义一个学生结构体类型student,包括4个字段,姓名.性别.年龄和成绩.然后在主函数中定义一个结构体数组(长度 ...

  3. Sencha Touch2 工作笔记

    Sencha Touch2 工作笔记 Ext.dataview.List activate( this, newActiveItem, oldActiveItem, eOpts ) Fires whe ...

  4. win10无法访问局域网共享文件?(因微软账户和本地账户登陆问题导致)

    1 笔记本系统win10 X64企业版,其中一文件夹已设置为“共享”.本地帐号登录系统. 2 平板电脑系统win8.1 X64专业版,可以顺畅的访问笔记本的共享文件.微软帐号登录系统. 3 平板电脑系 ...

  5. 责任链模式 - tomcat

    class filterChain{ private List<Filter> filters; public void addFilter(Filter filter){ filters ...

  6. Git服务器搭建全过程分步详解

    GitHub是一个免费托管开源代码的Git服务器,如果我们不想公开项目的源代码,又不想付费使用,那么我们可以自己搭建一台Git服务器. 下面我们就看看,如何在Ubuntu上搭建Git服务器.我们使用V ...

  7. Linux 精确获取指定目录对应的块的剩余空间

    #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/statfs ...

  8. 关于Unity的入门游戏飞机大战的开发(下)

    开发思路: 1: 修改测试模式,去掉开始按钮方便开发,加入敌机的资源2: 创建敌机 添加刚体,碰撞器组件,添加帧动画播放组件;3: 创建敌机出现的队形;4: 根据队形随机 生成我们的敌机,调整敌机的速 ...

  9. 关于Cocos2d-x的专属数据类型

    1.Size类定义的实例是一个有width和height属性的类 Size s = Size(44,52); 其中 s.width=44 s.height=52 2.Vec2是一个带有两个变量的(常量 ...

  10. e555. 在Applet中播放音频

    // See also e551 精简的Applet public void init() { // Load audio clip AudioClip ac = getAudioClip(getDo ...