Last active
June 17, 2017 15:32
-
-
Save pszklarska/544413ce0a3a53cdbef57f4dd4c53a2b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pl.pszklarska.leakexample; | |
public class SensorManagerLeakActivity extends AppCompatActivity implements SensorEventListener { | |
@Override | |
protected void onCreate(@Nullable final Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE); | |
Sensor lightSensor = sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT); | |
sensorManager.registerListener(this, lightSensor, SensorManager.SENSOR_DELAY_NORMAL); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment