Search in sources :

Example 1 with PlaybackFailedException

use of org.odk.collect.audioclips.PlaybackFailedException in project collect by opendatakit.

the class ODKView method setupAudioErrors.

private void setupAudioErrors() {
    audioHelper.getError().observe(viewLifecycle, e -> {
        if (e instanceof PlaybackFailedException) {
            final PlaybackFailedException playbackFailedException = (PlaybackFailedException) e;
            Toast.makeText(getContext(), getContext().getString(playbackFailedException.getExceptionMsg() == 0 ? R.string.file_missing : R.string.file_invalid, playbackFailedException.getURI()), Toast.LENGTH_SHORT).show();
            audioHelper.errorDisplayed();
        }
    });
}
Also used : PlaybackFailedException(org.odk.collect.audioclips.PlaybackFailedException)

Aggregations

PlaybackFailedException (org.odk.collect.audioclips.PlaybackFailedException)1