Skip to content Skip to sidebar Skip to footer

How To Get The No Of Track From An Artist In Mediastore

I am trying to get the no of track in Artist table using mediastore. I am able to get all the artist name but when I try to get the NUMBER_OF_TRACKS I am getting error .I searched

Solution 1:

I had a look at the database itself using Razorsql on a pc. The data is held in a view called artist_info. The required detail is there. Instead of

 MediaStore.Audio.Artists.NUMBER_OF_TRACKS);

try

 MediaStore.Audio.ArtistColumns.NUMBER_OF_TRACKS;

Found this example:

MediaStore.Audio.Artists.EXTERNAL_CONTENT_URI, newString[] {

        BaseColumns._ID,

        ArtistColumns.ARTIST,

        ArtistColumns.NUMBER_OF_ALBUMS,

        ArtistColumns.NUMBER_OF_TRACKS }, null, null,null);

Post a Comment for "How To Get The No Of Track From An Artist In Mediastore"