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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:05:29+00:00 2026-06-06T00:05:29+00:00

I use a CursorLoader in a LoaderManager with a Custom CursorAdapter. I’ve already achieved

  • 0

I use a CursorLoader in a LoaderManager with a Custom CursorAdapter. I’ve already achieved to display the Album and the associated Artist, and now I’d like to display the Cover.

Here is my Custom CursorAdapter :

public class AlbumsAdapter extends CursorAdapter {


    private final LayoutInflater mInflater;

     public AlbumsAdapter(Context context, Cursor c) {
        super(context, c);
        mInflater=LayoutInflater.from(context);

    }
    @Override
    public void bindView(View view, Context context, Cursor cursor) {

        TextView albumTitle =(TextView)view.findViewById(R.id.albumTextView);
        albumTitle.setText(cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Albums.ALBUM)));

        TextView artistName=(TextView)view.findViewById(R.id.artistTextView);
        artistName.setText(cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Albums.ARTIST)));

        ImageView albumCover=(ImageView)view.findViewById(R.id.artistTextView);
        // Here what should I do ?

    }
    @Override
    public View newView(Context context, Cursor cursor, ViewGroup parent) {
        final View view=mInflater.inflate(R.layout.albums_row,parent,false); 
        return view;
    }   
}

I’ve tried the following without success :

    String path = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Albums.ALBUM_ART));
    File imgFile = new  File(path);
    if(imgFile.exists()){

        Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());

        ImageView albumCover=(ImageView)view.findViewById(R.id.album_cover);
        albumCover.setImageBitmap(myBitmap);

    }

What does MediaStore.Audio.Albums.ALBUM_ART returns and how to use it to ake the ImageView disolay the cover ? Thanks.

  • 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-06T00:05:30+00:00Added an answer on June 6, 2026 at 12:05 am

    I’ve achieved to load the Albums Covers in the ImageViews with :

        String coverPath = cursor.getString(cursor.getColumnIndex(MediaStore.Audio.Albums.ALBUM_ART));
        Drawable img = Drawable.createFromPath(coverPath);
        ImageView coverAlbum=(ImageView)view.findViewById(R.id.album_cover);
        coverAlbum.setImageDrawable(img);
    

    The problem is that the list is very slow. I guess that I should scale down the resolution of the cover to consume less memory.

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

Sidebar

Related Questions

I am trying to convert my Android application to use the LoaderManager and CursorLoader.
I am using a CursorAdapter and ContentProvider , and I want to use CursorLoader
Use case: I've just entered insert mode, and typed some text. Now I want
Use case: Wanna insert custom annotation to fields in java class generated by JAXB
This is my code: package com.example.testcode; import android.app.ListFragment; import android.app.LoaderManager; import android.content.CursorLoader; import android.content.Loader;
I'm trying to use CursorLoader with a CursorTreeAdapter but am running into an issue
I have a ListView with a custom CursorAdapter. Between the parameter of CursorAdapter I
I want to know how to use the CursorLoader to populate the widgets on
I have never been happy with the code on my custom CursorAdapter until today
Use Html element SELECT in aspx page like: <SELECT id=MySelection name=MySelection runat=server DataValueField=ID DataTextField=Name></SELECT>

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.