Java tutorial
//package com.java2s; // Released under the Apache License, Version 2.0 import android.media.AudioManager; public class Main { /** * Utility method to abandon audio focus given an AudioManager object * @param am the AudioManager object * @param afChangeListener the foucs listener associated to the AudioManager */ public static void abandonFocus(AudioManager am, Object afChangeListener) { am.abandonAudioFocus((AudioManager.OnAudioFocusChangeListener) afChangeListener); } }