controller - Play song in android in default media player.... i dont want to create my own -
hi guys want make simple application. have 1 button when clicked play song who's uri hard coded. want user click button , song play in default media player don't have code media player buttons.
is possible ? u have better approach?
this whole situation arises problem of fetching album art :)
maybe helps ya:
mediaplayer mp = new mediaplayer(); mp.setlooping(true); try { mp.setdatasource(mfile); } catch (illegalargumentexception e) { e.printstacktrace(); } catch (illegalstateexception e) { e.printstacktrace(); } catch (ioexception e) { e.printstacktrace(); } try { mp.prepare(); } catch (illegalstateexception e) { e.printstacktrace(); } catch (ioexception e) { e.printstacktrace(); } mp.start();
mfile path mp3-file. maybe can share uri instead.
Comments
Post a Comment