开发者

How can I pass in 2 parameters to a AsyncTask class?

开发者 https://www.devze.com 2023-02-21 21:08 出处:网络
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 diff

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 pa开发者_如何转开发ss in a URL and a reference to a image vue.

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


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.

Not pretty, but it works.

0

精彩评论

暂无评论...
验证码 换一张
取 消