Code example for SensorManager

Methods: getDefaultSensor

0
	 
    @Test 
    public void getSensor_shouldBeConfigurable() { 
        Sensor sensor = Robolectric.newInstanceOf(Sensor.class);
        shadowOf(sensorManager).addSensor(Sensor.TYPE_ACCELEROMETER, sensor);
        assertSame(sensor, sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER));
    } 
 
	private class TestSensorEventListener implements SensorEventListener {
 
		@Override 
		public void onAccuracyChanged(Sensor sensor, int accuracy) {
		} 
 
		@Override 
		public void onSensorChanged(SensorEvent event) {
		} 
		 
	} 
}