Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
public class SlusalkeOut extends BroadcastReceiver {
@Override
public void onReceive(Context ctx, Intent intent) {
if (intent.getAction().equals(android.media.AudioManager.ACTION_AUDIO_BECOMING_NOISY)) {
Intent toggle = new Intent(ctx, Storitev.class);
toggle.setAction(Storitev.STOP_SONG);
ctx.startService(toggle);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment