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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:32:49+00:00 2026-06-13T20:32:49+00:00

I will build a listview with images from the web. I’ve also asked an

  • 0

I will build a listview with images from the web. I’ve also asked an other question before: Android ListView with images from special hashmap.
But now I tried to extend the SimpleAdapter. I use a hashmap to put the data. Then I use a new “ImageAdapter”:

public class ImageAdapter extends SimpleAdapter {

         public ImageAdapter(Context context,
                    List<? extends Map<String, ?>> data, int resource, String[] from,
                    int[] to) {
                super(context, data, resource, from, to);
                // TODO Auto-generated constructor stub
            }

         @Override
            public void setViewImage(ImageView v, String value) {
                super.setViewImage(v, value);
                URL url;
                try {
                    url = new URL(value);
                    URLConnection conn = url.openConnection();
                    conn.connect();
                    InputStream is = conn.getInputStream();
                    Bitmap bm = BitmapFactory.decodeStream(is);
                    v.setImageBitmap(bm);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }

          }

My list.xml:

[...]
<ImageView
            android:id="@+id/list_image"
            android:layout_width="50dip"
            android:layout_height="50dip" />
[...]

There is no error – but the imageview is blank / white! How could I fill the imageview with the image defined in data (as String / URL):

ada = new ImageAdapter(getApplicationContext(), data, R.layout.list, new String[] {"imgurl", "title", "date", "ex", "id"}, new int[] {R.id.list_image, android.R.id.text1, android.R.id.text2, R.id.text3});

Thanks for helping! I tried many variations…but nothing works 🙁

  • 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-13T20:32:50+00:00Added an answer on June 13, 2026 at 8:32 pm

    I recommend you to read this tutorial. You will learn about BaseAdapter, ViewHolder pattern and correct asynchronous image loading.

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

Sidebar

Related Questions

I am typing code from Head First iPhone Development (O'reilly) and Xcode will build
I am building a T4 template that will build a POCO from a LINQ
I will build an Asp.net MVC 3 web page. View : The view (web
I have a selection of images that I will build a backdrop to a
I will build a dashboard system for my apps, where a page will have
I will build a system where I want to reduce single-point-of-failures, and I need
Looking ahead in the likely event we will build a server farm rather than
I haven't figured out the correct programming architecture for: -WPF Application -Each build will
I am trying to install libguichan without allegro support, because allegro will not build
I am located behind a corporate proxy/firewall and, occasionally, my ANT build will fail

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.