Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6690539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:38:55+00:00 2026-05-26T05:38:55+00:00

I am trying to write an AsyncTask which takes an ImageView and path to

  • 0

I am trying to write an AsyncTask which takes an ImageView and path to the image as input and loads the image in a background thread. I wanted to know how I can pass both the ImageView and the path to the AsyncTask? The Params argument in the doInBackground can hold an array of data belonging to same class, but this is a different scenario as one of them is a View and another one is the path to a file (String).

One option I have, is to have the AsyncTask as an inner class and declare the ImageView as a class variable which can be accessed inside AsyncTask. I don’t want to do this, because the same task is used by multiple classes and it doesn’t conform to the DRY policy.

Any help is appreciated.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:38:56+00:00Added an answer on May 26, 2026 at 5:38 am

    you can use the ImageView’s setTag method, and give it the path of your image.
    your asynctask or background thread can then getTag your imageView and do whatever you want with it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying write a query to find records which don't have a matching record
I'm trying to write a blog post which includes a code segment inside a
Trying to write a code that searches hash values for specific string's (input by
Im trying to write a recursive function which returns the factorial of a number.
Im trying to write out an image file that has the following structure: P5
I've been trying write an application which will be able to connect to a
I've had problem when trying write a function which has a default value when
Trying to write a regex matcher for roman numerals. In sed (which I think
I am trying to write a snippet of code that takes a URL and
We've been trying write unit tests for a worker class written in C#, which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.