Skip to content

Instantly share code, notes, and snippets.

@MortimerGoro
Last active April 19, 2017 10:25
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/f3223f06067a4b6368c92d81f41f4eb8 to your computer and use it in GitHub Desktop.
Save MortimerGoro/f3223f06067a4b6368c92d81f41f4eb8 to your computer and use it in GitHub Desktop.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().takeSurface(null);
FrameLayout layout = new FrameLayout(this);
layout.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.MATCH_PARENT));
SurfaceView nativeSurface = new SurfaceView(this);
nativeSurface.getHolder().addCallback(this);
layout.addView(nativeSurface, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.MATCH_PARENT));
setContentView(layout);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment