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 ...
随机推荐
- C++报错集锦
(一)invalid initialization of non-const reference of type 'float&' from a temporary of type 'floa ...
- C语言 · 文本加密
算法提高 9-2 文本加密 时间限制:1.0s 内存限制:256.0MB 问题描述 先编写函数EncryptChar,按照下述规则将给定的字符c转化(加密)为新的字符:"A ...
- 一站式学习Wireshark(八):应用Wireshark过滤条件抓取特定数据流
应用抓包过滤,选择Capture | Options,扩展窗口查看到Capture Filter栏.双击选定的接口,如下图所示,弹出Edit Interface Settints窗口. 下图显示了Ed ...
- DataTable的AcceptChanges()和RejectChanges()方法
一.DataTable.AcceptChanges()方法 提交自上次调用AcceptChanges()方法以来对该表进行的所有更改.调用AcceptChanges()时,任何扔处于编辑模式的Data ...
- kettle的报错解决机制
在kettle执行的过程中,如果遇到错误,kettle会停止运行.在某些时候,并不希望kettle停止运行,这时候可以使用错误处理(Step Error Handling).错误处理允许你配置一个步骤 ...
- Quill + Framework 7 移动端无法获取焦点
Quill 是一个轻量级的富文本编辑器.最近公司项目中需要用到这个东东.使用方法可以直接查看它的官网地址或者Github地址: Github地址:quilljs 官网地址:quill官网 主要说一下用 ...
- js学习笔记28----事件默认行为
事件默认行为 : 当一个事件发生的时候浏览器自己会默认做的事情. 怎么阻止? 当前这个行为是什么事件触发的,然后在这个事件的处理函数中使用return false; 右键菜单事件 oncont ...
- laravel 参数配置
1:在项目根目录下有个叫.env的文件.这个文件是配置配置.由config文件下的app.php 直接读取. #参数解释 APP_ENV=local #访问地址 APP_DEBUG=true #是否开 ...
- 纯CSS实现圆角、可拖动的一个DIV模块层
<style>body{ margin:0px; padding:0px; font-size:14px;}#t { position:absolute; float:left; left ...
- Spring in Action 4th 学习笔记
约定: 一.@Xxx Class 表示被@Xxx注解的类.同理还有@Xxx注解的字段或方法. 例如:@Bean Method. 二.@Component Class 同时代指 @Controller. ...