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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:37:13+00:00 2026-05-26T01:37:13+00:00

My problem is that I have implemented a custom arrayadapter, that fetches images from

  • 0

My problem is that I have implemented a custom arrayadapter, that fetches images from an url and sets them to an imageview. It works, sort of. Sometimes some of the images are not showing up. Somtimes it’s only one image, somtimes it’s three and in no apparent order. Only thing that’s reasonably consistent is that it seems to be image number 3 in my arraylist.

My custom adapter:

public CustomAdapter( Context context, int textViewResourceId, List items )
{
        super( context, textViewResourceId, items );
        this.items = items;
}

@Override
public View getView( int position, View convertView, ViewGroup parent )
{
    View v = convertView;
    if ( v == null )
    {
        LayoutInflater vi =  ( LayoutInflater ) getContext().getSystemService( Context.LAYOUT_INFLATER_SERVICE );
        v = vi.inflate( R.layout.list_item, parent, false );
    }
    Object o = items.get( position );
    if  ( o != null )
    {
            TextView textView = ( TextView ) v.findViewById( R.id.listItem );
            ImageView imageView = ( ImageView ) v.findViewById( R.id.icon );

            if ( textView != null )
            {
                textView.setText( o.toString() );
            }
            if ( imageView != null )
            {
                if ( o instanceof XmlGuide )
                {
                    try
                    {
                        imageView.setImageBitmap( downloadIcon( ( ( XmlGuide ) o ).getIcon() ) );
                    }
                    catch( Exception e )
                    {
                        e.printStackTrace();
                    }
                }
            }
    }
    return v;
}

private Bitmap downloadIcon( String uri ) throws Exception
{
    URL url = new URL( uri );
    InputStream stream = url.openStream();
    Bitmap icon = BitmapFactory.decodeStream( stream );
    stream.close();
    return icon;
}
  • 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-26T01:37:13+00:00Added an answer on May 26, 2026 at 1:37 am

    I finally figured out the problem. The problem is that Android < 2.3 is not handling jpg images very well. There is one fix, which will fix this in most cases, but not all.

    You can read more about it here: http://code.google.com/p/android/issues/detail?id=6066

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

Sidebar

Related Questions

I have a control derived from a CWnd object that has its custom implemented
I have implemented a custom designer class which inherits from DocumentDesigner. The standard Form
We have implemented some custom tooltip-drawing code that fires on Tick events of a
I have implemented a custom Layout that extends RelativeLayout. It displays lots of different
I have a spring-ws (2.0.2) service I have implemented that requires some custom elements
I have a Cocoa app with a custom, multi-step account setup that I implemented
I have a problem that I feel is best implimented in a stand alone
I have encountered a problem that I have not come accross yet when setting
We have the problem that we have the open project files in our SVN
I have a problem that I have not faced before: It seems that the

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.