cancel
Showing results for 
Search instead for 
Did you mean: 

Notification in GearVR

aryanextvr
Honored Guest
Hi

I wanted to ask about showing and building notifications while users are in VR. I have tried every which way to get notifications to appear while users are in VR but it has never worked.
I want the notification to appear when a user presses a volume up or down key.

The most I can get to work is an icon. The volume click is going through so I know the volume is being adjusted, but the notification will not show up in VR.

Does anyone know how to include a notification?

if ( keyCode == KeyEvent.KEYCODE_VOLUME_UP ){
if ( event.getAction() == KeyEvent.ACTION_DOWN ) {
//audioManager.getAudioManager().adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_RAISE, AudioManager.FLAG_PLAY_SOUND | AudioManager.FLAG_SHOW_UI);
audioManager.getAudioManager().setStreamVolume(AudioManager.STREAM_MUSIC, 14, 0);

Notification notification = new Notification.Builder(this)
.setVisibility(Notification.VISIBILITY_PUBLIC)
.setTicker("dffdfddfdf")
.setSubText("FDdff")
.setContentText("fdfddffdfdfd")
.setContentTitle("fdfdfddf")
.setContentInfo("eeeeee")
.setColor(Color.argb(1, 255,0 ,0))
.setWhen(System.currentTimeMillis())
.build();



NotificationManager mNotificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
// mId allows you to update the notification later on.
mNotificationManager.notify(TAG, 0, notification);

}

4 REPLIES 4

aryanextvr
Honored Guest
Selfless bump

doles
Protege
We will be releasing an updated SDK soon that adds a implicit volume notifier layer so apps don't need to implement it themselves.

But in general, you really don't want to pop up any Android UI elements on top of a VR app. If you want to put up a head locked layer similar to volume notification we allow up to 4 timewarp layers when you call vrapi_SubmitFrame.

aryanextvr
Honored Guest
What will be the SDK version that will include the volume notifier bar?

raybondo
Honored Guest
Looks like the mobile sdk 1.0.3 was just released last week that now handles the volume control.