FileDocCategorySizeDatePackage
TouchRotateActivity.javaAPI DocAndroid 1.5 API6129Wed May 06 22:41:08 BST 2009com.example.android.apis.graphics

TouchRotateActivity

public class TouchRotateActivity extends android.app.Activity
Wrapper activity demonstrating the use of {@link GLSurfaceView}, a view that uses OpenGL drawing into a dedicated surface. Shows: + How to redraw in response to user input.

Fields Summary
private android.opengl.GLSurfaceView
mGLSurfaceView
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);

        // Create our Preview view and set it as the content of our
        // Activity
        mGLSurfaceView = new TouchSurfaceView(this);
        setContentView(mGLSurfaceView);
        mGLSurfaceView.requestFocus();
        mGLSurfaceView.setFocusableInTouchMode(true);
    
protected voidonPause()

        // Ideally a game should implement onResume() and onPause()
        // to take appropriate action when the activity looses focus
        super.onPause();
        mGLSurfaceView.onPause();
    
protected voidonResume()

        // Ideally a game should implement onResume() and onPause()
        // to take appropriate action when the activity looses focus
        super.onResume();
        mGLSurfaceView.onResume();