I have a class that implements an alarm. The receiver class is a broadcast receiver and I would like it to vibrate and play the default alarm sound when the alarm goes off. But it won’t let me use getSystemService in the broadcast receiver class.
Im guessing this is because it’s not an activity and can’t use it but how do I get around this? Should I change my receiving class to an activity class or alert dialog activity? What do you all suggest?
Cheers
You can use it. I do it in my BroadcastReceiver.
Do you have an error message? Or source code?
Please know that a broadcastreceiver only lasts 10 seconds at maximum.