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
Post a Comment