Jack
Jack

Reputation: 89

MediaPlayer in ListView on android

I would like display a ListView with each row containing a media player to play the music in the item. So please any can help from this.

Like this: example like samosa app

Upvotes: 1

Views: 761

Answers (2)

Machado
Machado

Reputation: 14499

I highly suggest you to use Lists and Cards, as they do what you want and follow the best Material Design patterns.

CardView extends the FrameLayout class and lets you show information inside cards that have a consistent look across the platform. CardView widgets can also have shadows and rounded corners.

Create a Custom Video Player and put inside it.

enter image description here

Upvotes: 0

codecharles
codecharles

Reputation: 21

Use a ListView filled up with Song's/Sound's names, get that as ID to play a Object (creating previously the Class) which will have as Attributes song_name as String and the song as MediaPlayer, when song_name and the Item clicked inside the ListView does match, reproduce the song of that object.

Hope this idea helps a little.

Upvotes: 1

Related Questions