Skip to content Skip to sidebar Skip to footer

How Do I Add Song Title And Album Art In A Listview And Launch A Player On Click?

I am making a music player app that contains several tabs (Songs, Playlist, Albums etc). Each represents by a fragment. As of now I have failed to create a even song list using med

Solution 1:

The code mAdapter = new SongsAdapter(getActivity(), null) is incorrect. Normally you pass the Cursor object on the second paramter. Code example:

CursortodoCursor= db.rawQuery("SELECT  * FROM todo_items", null);
TodoCursorAdaptertodoAdapter=newTodoCursorAdapter(this, todoCursor);

The sample code is from tutorial Populating a ListView with a CursorAdapter.

This way the cursor object in code cursor.moveToFirst(); in bindView() will be valid. But you have to perform a database query.

Post a Comment for "How Do I Add Song Title And Album Art In A Listview And Launch A Player On Click?"