Skip to content

Instantly share code, notes, and snippets.

@MortimerGoro
Last active August 7, 2017 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MortimerGoro/0a3e4f7d634471c0b2d90bce17789f63 to your computer and use it in GitHub Desktop.
Save MortimerGoro/0a3e4f7d634471c0b2d90bce17789f63 to your computer and use it in GitHub Desktop.
Gear VR SurfaceView
// Android SurfaceView initialization example
void init(final Activity activity) {
mSurfaceView = new SurfaceView(activity);
mSurfaceView.getHolder().addCallback(OVRService.this);
// Enabling setZOrderOnTop is very important! If not enabled a single swap_buffers
// on the NativeActivity's window will make the SurfaceView invisible.
mSurfaceView.setZOrderOnTop(true);
activity.getApplication().registerActivityLifecycleCallbacks(OVRService.this);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment