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

  • SEARCH
  • Home
  • 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 6015043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:46:44+00:00 2026-05-23T02:46:44+00:00

I must set the same image to two imageviews in my activity. The image

  • 0

I must set the same image to two imageviews in my activity. The image is downloaded from internet and set to the imageview 1 asynchronously by a method that takes as parameter the url of the picture and one imageview.

Can I synchronize the source of the imageview 2 with imageview 1 (i.e. as soon as the picture is set in image 1, it also set it to image 2)?

  • 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-23T02:46:45+00:00Added an answer on May 23, 2026 at 2:46 am

    You can change the download method so that it accepts a list or an array of ImageView or varargs: download(String url, ImageView... imageViews)

    Upd: synchronization of ImageViews can be done over subclassing it.

    class MyImageView extends ImageView {
        private OnImageChangedListener onImageChangedListener;
    
        public MyImageView(Context context) {
            super(context);
        }
    
        // Plus other constructors if needed
    
        // Call to super method and do callback
        // Override another method if needed
        @Override
        public void setImageBitmap(Bitmap bitmap) {
            super(bitmap);
            if (onImageChangedListener != null) {
                onImageChangedListener.onImageChanged(bitmap);
            }
        }
    
        public setOnImageChangedListener(OnImageChangedListener listener) {
            this.onImageChangedListener = listener;
        }
    
        public interface OnImageChangedListener() {
            public void onImageChanged(Bitmap bitmap);
        }
    }
    

    And set the listener:

    MyImageView imageView1 = ...
    
    imageView1.setOnImageChangedListener(new OnImageChangedListener() {
        @Override
        public void onImageChanged(Bitmap bitmap) {
            imageView2.setImageBitmap(bitmap);
        }
    });
    download(url, imageView1);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working on a project where a sequential set of methods must be run every
This must be a classic .NET question for anyone migrating from Java. .NET does
I must be overlooking something simple. I'm setting a variable from a query result
I am doing a transformation from a customoized set cover problem to a sat,
Problem: Printing from within BIDS 2008 R2 Preview tab hangs and must have the
I've set a background image for my UINavigationBar using a subclass and overriding the
I'm using PreferenceActivity to set some preferences about another BroadcastReciever that i have. While
I have a booking system that i'm trying to set up. I want to
There must be a generic way to transform some hierachical XML such as: <element1
I must implement a web service which expose a list of values (integers, custom

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.