Ringtone Manager API 23

I am trying to create an alarm function which the user can set an alarm, with the alarm playing for 6 seconds. The code I have works on my emulator but when I run it on my Android device no ringtone goes off. I thought it could have something to do with it being API 23, so I added in the permission check for READ_EXTERNAL_STORAGE permission but am getting an error with MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE

Manifest file:


MainAlarm Activity

MainAlarm Activity continued (2)

MainAlarm Activity continued (3)...

Read More »

By: StackOverFlow - Tuesday, 13 March

Related Posts

  • Older News
  • Caused by: android.util.AndroidRuntimeException StackOverFlow (2 days ago) - ***Please check my code i am getting an exception in Service in some android version Below is my error code please tell me how to fix this i addedtimer in...
  • How to solve java.lang.RuntimeException StackOverFlow (2 days ago) - Please help me I am getting error in serviceimport android.app.Service;import android.content.Context;import android.content.Intent;import android.content.SharedPreferences;import android.media.AudioManager;import android.media.Ringtone;import android.media.RingtoneManager;import android.net.Uri;import android.os.IBinder;import android.os.Vibrator;import android.support.annotation.Nullable;import java.util.Timer;import java.util.TimerTask;public class MyAlarmServiceClass extends Service{int ring_choice;String ring_array[]={"ring_a","ring_b","ring_c","ring_d","ring_e","ring_f","ring_g","ring_h","ring_i","ring_j","ring_k","ring_l"};Ringtone ringtone;public SharedPreferences...