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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:42:20+00:00 2026-06-03T06:42:20+00:00

This is my activity. private ImageLoader testing; testing = new ImageLoader(this); imageview = (ImageView)findViewById(R.id.image_alllatestnewstitle);

  • 0

This is my activity.

private ImageLoader testing;
testing = new ImageLoader(this);
imageview = (ImageView)findViewById(R.id.image_alllatestnewstitle);
...
...
...

This is in listview, so it will display multiple images.

private void filldata() {
    lv = (ListView) findViewById(android.R.id.list);

    String[] from = new String[] { "particularlatestnewstitle",
            "newscategorytitle", "newsdate" };
    int[] to = new int[] { R.id.text_particularlatestnewstitle,
            R.id.text_newscategorytitle, R.id.text_newsdate };

    fillMaps = new ArrayList<HashMap<String, String>>();
    for (int i = 0; i < webservice.news.size(); i++) {
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("particularlatestnewstitle", webservice.news.get(i)
                .getNtitle());
        map.put("newscategorytitle", webservice.news.get(i).getNewCatName());
        map.put("newsdate", webservice.news.get(i).getNArticalD());

        fillMaps.add(map);
        imageview = (ImageView)findViewById(R.id.image_alllatestnewstitle);
        imageview.setTag(imagepath[i]);
        testing.DisplayImage(imagepath[i], imageview);
    }
    SimpleAdapter adapter = new SimpleAdapter(this, fillMaps,
            R.layout.main_alllatestnewslist, from, to);
    lv.setAdapter(adapter);

This is my ImageLoader class

public void DisplayImage(String url, ImageView imageView)
{
    imageViews.put(imageView, url);
    Bitmap bitmap=memoryCache.get(url);
    if(bitmap!=null){
        System.out.println(url.toString());
        System.out.println(bitmap.toString());
        imageView.setImageBitmap(bitmap);
    }else
    {
        queuePhoto(url, imageView);
    }
}

This is the xml layout

<ImageView
    android:id="@+id/image_alllatestnewstitle"
    android:layout_width="134px"
    android:layout_height="80px"
    android:layout_marginBottom="5px"
    android:layout_marginLeft="10px"
    android:layout_marginRight="10px"
    android:layout_marginTop="5px"
    android:scaleType="centerCrop" />

I was print the result

url and bitmap

Both not null and display correct url link.

But when setimagebitmap, it got no error but the imageview also did not display the image.

What is the problem?

p/s: Request for more code if you need.

  • 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-03T06:42:21+00:00Added an answer on June 3, 2026 at 6:42 am

    I am sure you are using Lazy loading logic of Fedor.

    And now, based on the code you have provided i can say one thing, i.e. You forgot to set TAG to your ImageView before calling DisplayImage() method.

    testing.setTag(imagepath[i]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a new database in my Activity like this: @Override public void onCreate(Bundle
I have this in my first activity: private AdapterView.OnItemClickListener _itemClickLis = new OnItemClickListener() {
I have one SubjectTabActivity and i need to show listview on this activity. But
I'm binding to Service by this way: Activity class: ListenLocationService mService; @Override public void
public class GalleryImageAdapter extends BaseAdapter{ private Activity activity; private ArrayList<String> listOfImages; public ImageLoader imageLoader;
I have found this example Lazy load of images in ListView from Fedor which
This is my ListActivity after clicking on the list it will start a new
this is my activity code public class HomeActivity extends Activity { private String html
I am using this simple code public class Main extends Activity { private ProgressDialog
I have a listView with an adapter loading images from URLs through a ImageLoader

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.