コード例 #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");
            }
        }
コード例 #2
0
        public static void releaseAudioFocus(VrActivity act)
        {
            AudioManager audioManager = (AudioManager)act.getSystemService(Context.AUDIO_SERVICE);

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