diff --git a/android/src/main/java/com/RNPlayAudio/RNPlayAudioModule.java b/android/src/main/java/com/RNPlayAudio/RNPlayAudioModule.java index 1fc07d8..fa3c8f8 100644 --- a/android/src/main/java/com/RNPlayAudio/RNPlayAudioModule.java +++ b/android/src/main/java/com/RNPlayAudio/RNPlayAudioModule.java @@ -79,7 +79,7 @@ public void onPrepared(MediaPlayer mp) { mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); try { Uri uri = Uri.parse("android.resource://" + getReactApplicationContext().getPackageName() + "/raw/" + name); - mediaPlayer.setDataSource(uri); + mediaPlayer.setDataSource(getCurrentActivity(), uri); mediaPlayer.prepareAsync(); } catch(IOException e) { Log.e("RNPlayAudio", "Exception", e);