Код: Выделить всё
AlertDialog.Builder dialog = new AlertDialog.Builder(this);
dialog
.setCancelable(true)
.setMessage("File Path: " + path + "\n"
+ "Duration: " + duration + "\n"
+ "File Format: " + format + "\n"
+ "File Status: " + status)
.setTitle("File Information")
.setPositiveButton("Play", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Uri uri = null;
uri = Uri.parse(toPlay);
Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(uri, "audio/mp3");
startActivity(intent);
}
})
.setNegativeButton("Delete", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
}
})
.setNeutralButton("Ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
}
});
Now when I press the play button on the dialog, VLC player open (without making a selection of player from the installed ones) and show a dialog with following error:
VLC столкнулся с ошибкой с этим носителем. Пожалуйста, попробуйте обновить библиотеку мультимедиа
< /p>
< /blockquote>
Я попытался удалить VLC, но после того, как сделала это кнопку воспроизведения в моем диалоге < /code> ничего не делает. В чем может быть проблема.
Подробнее здесь: https://stackoverflow.com/questions/197 ... ia-android
Мобильная версия