Reputation: 1511
I want want application to start every 10 second play a sound alarm,i'm use the android alarm manager,every thing is good,but in the this line:
player = MediaPlayer.create(this, R.raw.music);
i want create media player,up line get error this parameter i show error this picture:
How can i solve that?thanks.
Upvotes: 0
Views: 112
Reputation: 29285
Replace this
with context
. Although, creating MediaPlayer
in a broadcast receiver is not a good way. Because onReceive
should return ASAP.
Upvotes: 1