FileDocCategorySizeDatePackage
CameraPreview.javaAPI DocGoogle Android v1.5 Example6773Sun Nov 11 13:01:04 GMT 2007com.google.android.samples.graphics

CameraPreview

public class CameraPreview extends android.app.Activity

Fields Summary
private Preview
mPreview
Constructors Summary
Methods Summary
protected booleanisFullscreenOpaque()

        // Our main window is set to translucent, but we know that we will
        // fill it with opaque data. Tell the system that so it can perform
        // some important optimizations.
        return true;
    
protected voidonCreate(android.os.Bundle icicle)

        super.onCreate(icicle);
        
        // Hide the window title.
        requestWindowFeature(Window.FEATURE_NO_TITLE);
    
        // Make sure to create a TRANSLUCENT window. This is recquired
        // for SurfaceView to work. Eventually this'll be done by
        // the system automatically.
        getWindow().setFormat(PixelFormat.TRANSLUCENT);
        
        // Create our Preview view and set it as the content of our
        // Activity
        mPreview = new Preview(this);
        setContentView(mPreview);
    
protected voidonPause()

        // Start Preview again when we resume.
        super.onPause();
        mPreview.pause();
    
protected voidonResume()

        // Because the CameraDevice object is not a shared resource,
        // it's very important to release it when the activity is paused.
        super.onResume();
        mPreview.resume();