AsyncTask的多输入参数的方法execute() [英] Multiple input parameters for the method execute() of AsyncTask

查看:1015
本文介绍了AsyncTask的多输入参数的方法execute()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家。我已阅读了android网站上的EXCUTE的)的AsyncTask的描述(:

everyone. I have read on the android site the description of the excute() of AsyncTask:

公开最终的AsyncTask< PARAMS,进展,结果>执行(参数... PARAMS)

但我的项目中,我已经阅读了code是这样的:

But within my project, I have read the code like this:

private static final int JSON = 0;
private static final int NAME = 1;
@Override
protected String doInBackground(String... strData) {    
       FileOutputTask task = new FileOutputTask(context);
       task.execute(strData[JSON], strData[NAME]);
}

有人能告诉我为什么有 2的输入参数作为执行()方式?

由于根据本说明书中,应该只有一个输入参数。

Since according the specification, there should be only one input parameter.

在此先感谢!

推荐答案

参数... PARAMS PARAMS [] PARAMS 。只要你想,你可以发送尽可能多的PARAMS。

Read Params... params as Params[] params. You can send as many params as you want.

这篇关于AsyncTask的多输入参数的方法execute()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆