This is my code.what i am using?
Intent intent = new Intent(Intent.ACTION_DEFAULT);
intent.setDataAndType(Uri.parse(fileName), "audio/*");
startActivity(intent);
It is giving error
android.content.ActivityNotFoundException: No Activity found to han开发者_JAVA技巧dle Intent { act=android.intent.action.VIEW dat=/mnt/sdcard/DCIM/Hitesh_2011-04-19Time10-55.amr typ=audio/* }
is there any permission to use native player.what is the issue?
plz help me.plz Thanks in advance.
i dont get what do you mean by native player. but still this is the code that i have used to play a local file in the sdcard using the default player.
Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
Uri data = Uri.parse("file://"+Environment.getExternalStorageDirectory()
.getAbsolutePath()+"/" + fileName);
String type = "audio/mp3";
intent.setDataAndType(data, type);
startActivity(intent);
Hope it helps and let me know the output of it.
精彩评论