Android MediaPlayer cannot play files that contain '#' character in the file name using Uri.parse("...#.mp3") -


my media player works playing other file names have tried except file names have '#' in them

mediaplayer m_mediaplayer; 

...

m_mediaplayer = mediaplayer.create(this, uri.parse(musicfile)); 

where musicfile string filename = "/storage/emulated/0/music/asot 643 (2013-12-12) (inspiron)/31 geert huinink & mike van fabio - kingdom [future favorite #641].mp3"

m_mediaplayer returns null...if remove '#' file name works other songs. seems uri.parse(musicfile) gets confused hashtag seems.

any appreciated in solving this.

you're passing uri. # in uri anchor tag. uri.parse thinks filename ends @ #, , rest fragment. basically, can't use uri.parse. i'd @ using uri.fromfile instead

edit: found better method fromparts- fromfile


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -