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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:30:25+00:00 2026-05-23T17:30:25+00:00

I have an application that uses images from web a a source. for my

  • 0

I have an application that uses images from web a a source. for my application I’m first downloading images in seperate thread and only if image exists on disk I show on the list. Downloader is a seperate thread, but I’m very new using threads and now something else is confusing me. My images are not shown unless I refresh the view, that is my list. Now I needed to show my images so I wrote this in my custom view :

private  Runnable LoaderTask=new Runnable(){
    public void run() {
        if(cellIcon!=null){
            if(iconCache.get(cellIcon)!=null){              
                icon.setImageBitmap(iconCache.get(cellIcon)); 
                mHandler.postDelayed(this, 200);
            }
        }

    }

};
private class ImageThread extends Thread{

    @Override
    public void run() {
        //  mHandler.removeCallbacks(LoaderTask);
          mHandler.postDelayed(LoaderTask, 100);


    }

}

And I trigger my thread like this

  ImageThread thread=new ImageThread();
    thread.start();

the handler is instantiated in the beginning of the class. But when I do this n othing happen until I refresh my views. I tried (Activity).runOnUIThread inside one of my threads I got stackoverflow error. How do I solve that or are there any other advices.you can give me? 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-23T17:30:26+00:00Added an answer on May 23, 2026 at 5:30 pm

    Use AsyncTask. In onPostExecute() method just call a method from the activity and refresh the UI. The onPostExecute() is called when the thread is done.

    http://developer.android.com/resources/articles/painless-threading.html

    P.S. To call an activity’s method just use Interface.

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

Sidebar

Related Questions

I have set up a Django application that uses images. I think I have
I have never written any code that uses threads. I have a web application
I have developed an image uploading application that uses Flash to load an image,
I have developed a web application for mobile phones that uses JavaScript Google API.
I have a simple ASP.NET MVC web application that uses NHibernate with FluentNHibernate's auto
I have a ASP.NET web application that uses Themes. Inside the theme directory are
I have an application that uses pictures, audio and some text from .txt... The
I have a web application that uses jQuery to load some sound effect on
I have an application that uses NHibernate as its ORM and sometimes it experiences
I have client application that uses WCF service to insert some data to backend

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.