Android英文文档翻译系列(3)——AsyncTask
AsyncTask——异步任务个人认为这是翻译比较好的一次。。
Class Overview//类概述AsyncTask enables proper and easy use of the UI thread. This class allows to perform background operations and publish results on the UI thread without having to manipulate threads and/or handlers. //异步任务用在UI线程更适当和简单,这个类允许执行一个后台运作并且发布结果到UI线程而不需要去操作线程和Handler。 An asynchronous task is defined by a computation that runs on a background thread and whose result is published on the UI thread. An asynchronous task is defined by 3 generic types, called //一个异步任务被定义在运行后台线程和结果返回值UI线程的操作里面,一个异步任务定义了3个泛型,调用传入参数、执行进度和执行结果,并调用这4步: AsyncTask's generic types//异步任务的泛型参数The three types used by an asynchronous task are the following: //这个三个被异步任务调用的类型如下
Not all types are always used by an asynchronous task. To mark a type as unused, simply use the type //不是所有的类型都要用在异步任务上,也可标志为不需使用,参数类型改为Void即可。 private class MyTask extends AsyncTask<Void, Void, Void> { ... } The 4 steps//四大部When an asynchronous task is executed, the task goes through 4 steps://当一个异步任务执行了,将会走一下
Threading rules//线程规则There are a few threading rules that must be followed for this class to work properly: //这个累必须符合以下规则才能正确的执行
Memory observability//内存观察AsyncTask guarantees that all callback calls are synchronized in such a way that the following operations are safe without explicit synchronizations.异步任务必须保证所有的回调都是线程安全的同步的。
|
Android英文文档翻译系列(3)——AsyncTask的更多相关文章
- Android英文文档翻译系列(1)——AlarmManager
原文:个人翻译,水平有限,欢迎看官指正. public class Ala ...
- Android英文文档翻译系列(6)——LocalBroadcastManager
public class LocalBroadcastManager extends Object java.lang.Object ↳ android.support.v4.content.L ...
- Android英文文档翻译系列(5)——VPNService
API14位于android.net.VpnService 类概述|Class OverviewVpnService is a base class for applications to ext ...
- Android英文文档翻译系列(4)——PopupWindow
public class PopupWindow extends Object //直接继承至Object java.lang.Object ↳ android.widget.PopupWindow ...
- Android英文文档翻译系列(2)——HandlerThread
public class HandlerThread extends Thread Class Overview Handy class for starting a new threa ...
- Android异步处理系列文章四篇之四 AsyncTask的实现原理
Android异步处理一:使用Thread+Handler实现非UI线程更新UI界面Android异步处理二:使用AsyncTask异步更新UI界面Android异步处理三:Handler+Loope ...
- Android异步处理系列文章四篇之二 使用AsyncTask异步更新UI界面
Android异步处理一:使用Thread+Handler实现非UI线程更新UI界面Android异步处理二:使用AsyncTask异步更新UI界面Android异步处理三:Handler+Loope ...
- 【转载】Android异步处理系列文章
本博文地址:http://blog.csdn.net/mylzc/article/details/6777767 转载请注明出处. 为了给用户带来良好的交互体验,在Android应用的开发过程中需要把 ...
- Android之Activity系列总结(一)--Activity概览
Activity 本文内容 创建 Activity 实现用户界面 在清单文件中声明 Activity 启动 Activity 启动 Activity 以获得结果 结束 Activity 管理 Acti ...
随机推荐
- 【Visual Studio】报错SignTool Error: No certificates were found that met all the given criteria.
问题:Virtual Studio如果证书或SignTool.exe签名工具出了问题,编译运行项目时会报这个错误. 解决:参考下面内容. http://stackoverflow.com/questi ...
- docker 部署nginx+weblogic集群
測试一段时间.再来报告
- 设置cookies第二天0点过期
网上这个资料很少,试了csdn其中一个人的方法去算时间,返回的是Invalid Date,不知道是不是不同IE版本 返回结果不同 后面找到另外一个很简答粗暴的方法 直接加一天后,设置时分秒为0,代码如 ...
- Hibernate- QBC-基本查询
01.环境搭建 02.基本查询 1.方法说明 方法 说明 Restrictions.eq = Restrictions.allEq 利用Map来进行多个等于的限制 Restrictions.gt &g ...
- C/C++-中的sort排序用法
转载于:http://www.cnblogs.com/luorende/p/6121906.htmlSTL中就自带了排序函数sortsort 对给定区间所有元素进行排序 要使用此函数只需用#inclu ...
- MVC路由机制(转)
今天我来缕一下MVC的路由机制,因为使用MVC已经快一年了,之前也只是上手,没有系统去理会.项目完了,结合实际使用,回过头来深入一下. MVC 学习索引(点击即可) 一个请求进入IIS后 传统ASP. ...
- 质量管理是SQA(软件质量保证)人员的职责
质量管理是SQA(软件质量保证)人员的职责
- 有了malloc/free 为什么还要new/delete ?
有了malloc/free 为什么还要new/delete ? malloc 与 free 是 C++/C 语言的标准库函数,new/delete 是 C++的运算符.它们都可 用于申请动态内存和释放 ...
- linux下常用FTP命令 1. 连接ftp服务器
1. 连接ftp服务器 格式:ftp [hostname| ip-address] a)在linux命令行下输入: ftp 192.168.1.1 b)服务器询问你用户名和密码,分别输入用户名和相应密 ...
- jquery.attach附件上传jquery插件
html: <!DOCTYPE html> <html lang="zh-cn"> <head> <meta http-equiv=&qu ...