Skip to content

Instantly share code, notes, and snippets.

@dz0ny
Created July 26, 2012 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dz0ny/3183338 to your computer and use it in GitHub Desktop.
Save dz0ny/3183338 to your computer and use it in GitHub Desktop.
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