我怎么能在2参数传递到AsyncTask的班?

问题描述:

我加载在使用的AsyncTask类背景位图。我用的是execute方法把字符串为位图的网址加载一个数组中为止。我想将位图加载到不同Imagevues。我的想法是在一个URL和一个图像VUE的引用来传递。

I'm loading a bitmap in the background using the AsyncTask class. I use the the execute method to take in a array of strings for the URL of the bitmap to load. I would like to load the bitmap into different Imagevues. My idea was to pass in a URL and a reference to a image vue.

我想不出一个简单的方法来做到这一点,因为执行只需要1参数。我怎么能这样做呢?

I can't figure out a easy way to do this, because execute only takes in 1 parameter. How could I do this?

创建一个包装对象来保存两个参数,或者只是使用类似的ArrayList或解释,并在其中既坚持你的参数。

Create a wrapper object to hold the two parameters, or just use something like an ArrayList or Dictionary and stick both your parameters in it.

不是pretty,但它的作品。

Not pretty, but it works.