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

Compass

public class Compass extends GraphicsActivity

Fields Summary
private static final String
TAG
private android.hardware.SensorManager
mSensorManager
private SampleView
mView
private float[]
mValues
private final android.hardware.SensorListener
mListener
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle icicle)


    
        
        super.onCreate(icicle);
        mSensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE);
        mView = new SampleView(this);
        setContentView(mView);
    
protected voidonResume()

        if (Config.LOGD) Log.d(TAG, "onResume");
        super.onResume();
        mSensorManager.registerListener(mListener, 
        		SensorManager.SENSOR_ORIENTATION,
        		SensorManager.SENSOR_DELAY_GAME);
    
protected voidonStop()

        if (Config.LOGD) Log.d(TAG, "onStop");
        mSensorManager.unregisterListener(mListener);
        super.onStop();