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 9019717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:50:49+00:00 2026-06-16T04:50:49+00:00

public class LoadImageActivity extends Activity { ImageView image_view; /** Called when the activity is

  • 0
public class LoadImageActivity extends Activity {

    ImageView image_view;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        image_view = (ImageView)findViewById(R.id.imageview);
        me m1=new me();
        m1.execute("http://wallbase1.org/thumbs/rozne/thumb-499842.jpg");
        me m2=new me();
        m2.execute( "http://wallbase1.org/thumbs/rozne/thumb-637449.jpg"); 
        me m3=new me();
        m3.execute( "http://wallbase1.org/thumbs/rozne/thumb-2509834.jpg"); 
        me m4=new me();
        m4.execute( "http://wallbase1.org/thumbs/rozne/thumb-2501884.jpg"); 
        me m5=new me();
        m5.execute( "http://wallbase1.org/thumbs/rozne/thumb-2514440.jpg");
     };


     class me extends AsyncTask<String, Integer, Bitmap> {

        Bitmap b1;

        // private MainActivity m1;
        protected Bitmap doInBackground(String...params) {
            // TODO Auto-generated method stub
             try {

                  /* Open a new URL and get the InputStream to load data from it. */

                  URL aURL = new URL(params[0]);
                  URLConnection conn = aURL.openConnection();
                  conn.connect();
                  InputStream is = conn.getInputStream();

                  /* Buffered is always good for a performance plus. */
                  BufferedInputStream bis = new BufferedInputStream(is);

                  /* Decode url-data to a bitmap. */
                  Bitmap bm = BitmapFactory.decodeStream(bis);
                  b1=bm;

                  bis.close();
                  is.close();

              } catch (IOException e) 
              {

                  Log.e("DEBUGTAG", "Remote Image Exception", e);

              }

           return null;
       }

    @Override
        protected void onPostExecute(Bitmap result) {
            // TODO Auto-generated method stub
            super.onPostExecute(result);

            image_view.setImageBitmap(b1);
            Animation rotation = AnimationUtils.loadAnimation(LoadImageActivity.this, R.anim.rotate);
         image_view.startAnimation(rotation);
    }
        }}

I am trying to show an image from internet by decoding it into bitmap,i want to show multiple images from multiple urls.Is there any better way of implementing it?

  • 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-06-16T04:50:50+00:00Added an answer on June 16, 2026 at 4:50 am

    The duration of a download depends on a lot of different stuff. You currently spawn 5 AsyncTasks and there is no guarantee that the order of delivery/execution will be the same order you spawned them. It is easily possible that the fifth image might be the first you received and this would result in a totally wrong order. So you should download all images first, possibly with just one AsyncTask. After that and if that succeeded, you should start the animation and switch between the images.

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

Sidebar

Related Questions

public class XPBN extends Activity{ private Map _map; @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState);
public class MainActivity extends Activity { Button b; //FrameLayout fl; @Override protected void onCreate(Bundle
public class ImportContactsActivity extends Activity { /** Called when the activity is first created.
public class MyActivity extends Activity { /** Called when the activity is first created.
public class ListView extends ListActivity { static String item; public void onCreate(Bundle icicle) {
public class HttpPostTask extends AsyncTask<Void, Integer, Void> { TextView txtStatus = (TextView)findViewById(R.id.txtStatus); @Override protected
public class AycanClass extends AsyncTask<String, Void, String> implements IAppointments { Activity activity; public AycanClass(Activity
public class tryAnimActivity extends Activity { /** * The thread to process splash screen
public class TwitterActivity extends Activity { private Twitter twitter; private OAuthProvider provider; private CommonsHttpOAuthConsumer
public class LineNum1 extends Thread{ public synchronized void run() { try { Hello.main(null); System.out.println(Stack

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.