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

  • Home
  • SEARCH
  • 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 6135123
In Process

The Archive Base Latest Questions

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

Ok so Ive spent the last two days looking for a good simple example

  • 0

Ok so Ive spent the last two days looking for a good simple example of how to use the images on a device to populate a list view and Ive come to the conclusion that there is no easy way to do this. I know that everytime I put together bits and pieces from some one elses examples that I usually end up with lots of extra code i dont need. Can some one please show me how to simply load images from the device to a list view. There is no book, tutorial, or post on here that just simply shows how to do this and its kind of funny and crazy at the same time.

  • 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:26:28+00:00Added an answer on May 23, 2026 at 5:26 pm

    Here’s the rest of the code, using the SDImageLoader linked to above from here: http://www.samcoles.co.uk/mobile/android-asynchronously-load-image-from-sd-card

    The ListAdapter class:

    public class PBListAdapter extends SimpleCursorAdapter {
    
    //MEMBERS:
    
    private int mLayoutId;
    private SpecimenHunterDatabaseAdapter mDbHelper;
    private final SDImageLoader mImageLoader = new SDImageLoader();
    
    
    //METHODS:
    
    public PBListAdapter(Context context, int layout, Cursor c) {
        super(context, layout, c, new String[] {}, new int[] {});
        mLayoutId = layout; 
        mDbHelper = new SpecimenHunterDatabaseAdapter(context);
        mDbHelper.open();
    }
    
    @Override
    public View newView(Context context, Cursor c, ViewGroup parent) {
        final LayoutInflater inflater = LayoutInflater.from(context);
        View v = inflater.inflate(mLayoutId, parent, false);
        return v;               
    }
    
    @Override
    public void bindView(View v, Context context, Cursor c) {   
    
        String title = c.getString(c.getColumnIndexOrThrow(SpecimenHunterDatabaseAdapter.KEY_CAPTURES_TITLE));
        String species = mDbHelper.fetchSpeciesName(c.getInt(c.getColumnIndexOrThrow(SpecimenHunterDatabaseAdapter.KEY_CAPTURES_SPECIES)));
        int pounds = c.getInt((c.getColumnIndexOrThrow(SpecimenHunterDatabaseAdapter.KEY_CAPTURES_POUNDS)));
        int ounces = c.getInt((c.getColumnIndexOrThrow(SpecimenHunterDatabaseAdapter.KEY_CAPTURES_OUNCES)));
        int drams = c.getInt((c.getColumnIndexOrThrow(SpecimenHunterDatabaseAdapter.KEY_CAPTURES_DRAMS)));  
        String weight = pounds + context.getString(R.string.addcapture_pounds) + " " +
                        ounces + context.getString(R.string.addcapture_ounces) + " " + 
                        drams + context.getString(R.string.addcapture_drams);
        String photoFilePath = c.getString(c.getColumnIndexOrThrow(SpecimenHunterDatabaseAdapter.KEY_CAPTURES_PHOTO));
        String comment = c.getString(c.getColumnIndexOrThrow(SpecimenHunterDatabaseAdapter.KEY_CAPTURES_COMMENT));
    
        TextView nameView = (TextView)v.findViewById(R.id.pb_row_species_name);
        TextView weightView = (TextView)v.findViewById(R.id.pb_row_capture_weight);
        TextView titleView = (TextView)v.findViewById(R.id.pb_row_capture_title);
        TextView commentView = (TextView)v.findViewById(R.id.pb_row_capture_comment);
        ImageView photoView = (ImageView)v.findViewById(R.id.pb_row_capture_photo);
    
        mImageLoader.load(context, photoFilePath, photoView);       
        nameView.setText(species);
        titleView.setText(title);
        weightView.setText(weight);
        commentView.setText(comment);
    }
    }
    

    In the actual ListActivity, in your onCreate() set the list adapter:

    private void bindData() {       
        Cursor c = mDbHelper.fetchAllPBs();
        startManagingCursor(c);     
        setListAdapter(new PBListAdapter(this, R.layout.pb_list_item, c));
    }
    

    In my example the absolute filepaths for the images are stored in the database when added via the app.

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

Sidebar

Related Questions

I've spent the last two days hunting JavaScript memory leaks in my web project
I've spent the last two days trying to find a solution to this problem
I've spent the last couple of days grappling wit the simple concept of using
I've spent two days on this and I still can't find the cause of
So I've been using Erlang for the last eight hours, and I've spent two
I've spent two days on this so far and combed through every source at
I've spent last 2 days trying to launch examples from Boost.Python with the ImportError:
I've spent that last two hours starring at the most cookie cutter block of
I've spent the last day or so looking in CAS and have managed to
This may seem like a simple question however i've spent the last hour trying

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.