Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- protected void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- switch (requestCode){
- case Pick_song:
- if (resultCode ==RESULT_OK) {
- String patch = data.getDataString();
- try{
- MediaPlayer audio = new MediaPlayer();
- audio.setDataSource(getApplicationContext(), Uri.parse(patch));
- audio.prepare();
- audio.start();
- }catch (Exception e){
- Toast.makeText(this, "erro ao executar o áudio", Toast.LENGTH_SHORT).show();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement