public static void requestAudioFocus(VrActivity act) { AudioManager audioManager = (AudioManager)act.getSystemService(Context.AUDIO_SERVICE); // Request audio focus int result = audioManager.requestAudioFocus(act, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN); if (result == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) { Log.d(TAG, "requestAudioFocus(): GRANTED audio focus"); } else if (result == AudioManager.AUDIOFOCUS_REQUEST_FAILED) { Log.d(TAG, "requestAudioFocus(): FAILED to gain audio focus"); } }
public static void releaseAudioFocus(VrActivity act) { AudioManager audioManager = (AudioManager)act.getSystemService(Context.AUDIO_SERVICE); audioManager.abandonAudioFocus(act); }
public static void nativeOnCreate(VrActivity act) { }