I want TextViews to display the sensors readings in a Fragment. When trying to initialize the SensorManager the getSystemService
TextViews
Fragment
SensorManager
getSystemService
You can also get the context from the LayoutInflater.
SensorManager sm = (SensorManager) getLayoutInflater().getContext().getSystemService(Context.SENSOR_SERVICE);