I want TextViews to display the sensors readings in a Fragment. When trying to initialize the SensorManager the getSystemService
TextViews
Fragment
SensorManager
getSystemService
sensorManager = (SensorManager) getActivity().getSystemService(Context.NAMEOF_SERVICE);
Fragments cannot directly call System Services , You have to use Activity with which these Fragment is Attached