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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:57:32+00:00 2026-06-15T23:57:32+00:00

I’ve seen an example about how to show textview and imageview in an listview.

  • 0

I’ve seen an example about how to show textview and imageview in an listview. These image files are in drawable file.

public View getView(int position, View convertView, ViewGroup parent) {   

                if(convertView==null){   
                    convertView=LayoutInflater.from(mContext).inflate(R.layout.item, null);   
                    ItemViewCache viewCache=new ItemViewCache();   
                    viewCache.mTextView=(TextView)convertView.findViewById(R.id.text); 
                    viewCache.mTextView1=(TextView)convertView.findViewById(R.id.text1);
                    viewCache.mImageView=(ImageView)convertView.findViewById(R.id.image);   
                    convertView.setTag(viewCache);   
                }   
                ItemViewCache cache=(ItemViewCache)convertView.getTag();   

                cache.mTextView.setText(texts[position]);  
                cache.mTextView1.setText(texts1[position]);
                cache.mImageView.setImageResource(images[position]);
                return convertView;   
            }   
        }   
                    private static class ItemViewCache{   
            public TextView mTextView;  
            public TextView mTextView1;
            public ImageView mImageView;   
        }   

        private  String[] texts=new String[]{"one","two","three"}; 
        private  String[] texts1=new String[]{"wether","tuan","background"};
        private int[] images=new int[]{R.drawable.img1,R.drawable.img2,R.drawable.img3};

But what I have is the external url links of these images:

private String[] images=new String[]{"http://ia.media-imdb.com/images/M/MV5BMjMyOTM4MDMxNV5BMl5BanBnXkFtZTcwNjIyNzExOA@@._V1._SX54_CR0,0,54,74_.jpg",
                "http://i.media-imdb.com/images/SF1f0a42ee1aa08d477a576fbbf7562eed/realm/feature.gif",
                "http://ia.media-imdb.com/images/M/MV5BMzk3MTE5MDU5NV5BMl5BanBnXkFtZTYwMjY3NTY3._V1._SX54_CR0,0,54,74_.jpg"};

What method should I use to show these images?

  • 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-15T23:57:33+00:00Added an answer on June 15, 2026 at 11:57 pm

    You can load the images using steve’s code from How to load an ImageView by URL in Android?

    Now you have two options:

    1) Use a custom listview (where you create an xml file displaying an imageview, textview, and possibly other items you need for each row in your list)

    2) Use the standard listview which contains just a TextView (which has a CompoundDrawable which allows you to position the image to the left/right/top/below the text)

    1) Custom List View

    Create an xml resource for your row layout which contains a textview and an imageview (and possibly other items) then display it in your list view calling setImageBitmap on the ImageView. For details on creating a custom listview, see the tutorial at http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/

    2) Standard Listview

    Call setCompoundDrawableWithIntrinsicBounds on the default textview to set the appropriate Drawable for your image. To convert your bitmap to a drawable, see How to convert a Bitmap to Drawable in android?

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

Sidebar

Related Questions

I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I want to show the soap response to UIWebview.. my soap response is, <p><img
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I don't have much knowledge about the IPv6 protocol, so sorry if the question

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.