Code example for FragmentActivity

Methods: getSupportFragmentManager, getSystemService, onStart

0
        loadSaved = (Button) findViewById(R.id.loader);
    } 
     
    @Override 
    protected void onStart() { 
    	super.onStart(); 
    	 
    	// Check if the GPS setting is currently enabled on the device. 
    	LocationManager locationManager =
    			(LocationManager) getSystemService(Context.LOCATION_SERVICE);
    	final boolean gpsEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
    	 
    	if (!gpsEnabled) {
    		// Alert dialog to enable GPS 
    		new EnableGpsDialogFragment().show(getSupportFragmentManager(), "enableGpsDialog");
    	} 
    } 
     
    @Override 
    protected void onResume() { 
    	super.onResume();