getSystemServices is undefined when called in a Fragment?
问题 I want TextViews to display the sensors readings in a Fragment . When trying to initialize the SensorManager the getSystemServices is undefined in the Fragment , eclipse says.Why and how to fix it. Fragment public class FragSensors extends Fragment { private TextView accXTv, accYTv, accZTv; private SensorManager sensorManager; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // TODO Auto-generated method stub View v = inflater