super.onCreate(savedInstanceState); FrameLayout content = new FrameLayout(this); mSurfaceView = new SurfaceView(this); mSurfaceView.getHolder().addCallback(this); content.addView(mSurfaceView, new FrameLayout.LayoutParams( FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT, Gravity.CENTER)); setContentView(content);
mThread.setSize(width, height);
mThread = new RenderingThread(holder.getSurface()); mThread.start();
if (mThread != null) mThread.stopRendering();