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 ...
随机推荐
- thrift与protobuffer的区别
thrift由facebook出品,protobuffer由google出品: 下面对比一下这两个的区别.参考:http://zhidao.baidu.com/link?url=yNLBeHhWokf ...
- JavaScript 使用 php 的变量
php 里面有一个变量,我想让 js 调用他, 有如下流程: <?php for ($i = 0; $i < 8; $i++) { echo "<tr>"; ...
- FreeMarker MyEclipse IDE
1. 下载freemarker-ide : http://sourceforge.net/projects/freemarker-ide/files/ 2. 下载完成后解压,由于IDE中的freema ...
- MongoDB(三):MongoDB概念解析
在上一篇文章中讲解了如何安装MongoDB,这篇文章中讲解一些有关MongoDB的概念. 不管我们要学习什么数据库,都应该学习其中的基础概念,在MongoDB中基本的概念是文档.集合.数据库,下面挨个 ...
- 轻量级ORM框架Dapper应用五:使用Dapper实现Join操作
在这篇文章中,讲解如何使用Dapper使用Inner join的操作 1.新创建两张表:Users表和Product表 Users表定义如下: CREATE TABLE [dbo].[Users]( ...
- spring boot之访问静态页面
楼主前两天自学spring boot,然后在学习的过程中,出现一个疑问,就是如何去访问静态的html网页,这个问题,楼主上网上搜了下,找到的是在resource目录下建立一个templates文件夹, ...
- 简单又好用的聊天室技术——WebSocket
现在,很多网站为了实现推送技术,所用的技术都是轮询.轮询是在特定的的时间间隔(如每1秒),由浏览器对服务器发出HTTP request,然后由服务器返回最新的数据给客户端的浏览器.这种传统的模式带来很 ...
- ROS :为IDE配置环境变量
ROS hydro 自带安装好了opencv 2.4 为了在自己经常使用的开发环境Eric下调用,需要配置Eric的环境变量,好让它可以调用ROS的资源,当然你用其他IDE也要这样配置,配置好了环境变 ...
- bootstrap -- css -- 表单控件
若干css样式 .form-control { display: block; width: 100%; height: 34px; padding: 6px 12px; font-size: 14p ...
- JS中document对象详解
转自:http://www.cnblogs.com/andycai/archive/2010/06/29/1767351.html 对象属性 document.title //设置文档标题等价于HTM ...