Code example for UnsupportedOperationException

0
                SensorManager.SENSOR_ACCELEROMETER,
                SensorManager.SENSOR_DELAY_GAME);
        if (!supported) {
            mSensorMgr.unregisterListener(this,
                    SensorManager.SENSOR_ACCELEROMETER);
            throw new UnsupportedOperationException(
                    "Accelerometer not supported"); 
        } 
    } 
 
    public void pause() { 
        if (mSensorMgr != null) {
            mSensorMgr.unregisterListener(this, SensorManager.SENSOR_ACCELEROMETER);
            mSensorMgr = null;
        } 
    } 
 
    public void onAccuracyChanged(int sensor, int accuracy) {
    } 
 
    public void onSensorChanged(int sensor, float[] values) {