Esempio n. 1
0
        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");
            }
        }
Esempio n. 2
0
        public static void releaseAudioFocus(VrActivity act)
        {
            AudioManager audioManager = (AudioManager)act.getSystemService(Context.AUDIO_SERVICE);

            audioManager.abandonAudioFocus(act);
        }
Esempio n. 3
0
 public static void nativeOnCreate(VrActivity act)
 {
 }
Esempio n. 4
0
 public static void releaseAudioFocus(VrActivity act)
 {
     AudioManager audioManager = (AudioManager)act.getSystemService(Context.AUDIO_SERVICE);
     audioManager.abandonAudioFocus(act);
 }
Esempio n. 5
0
        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");
            }
        }
Esempio n. 6
0
 public static void nativeOnCreate(VrActivity act) { }