Code example for FragmentActivity

Methods: getSupportFragmentManager, getSystemService, onStart

        loadSaved = (Button) findViewById(;
    protected void 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");
    protected void onResume() { 
Stop searching for code, let great code find you!  Add Codota to your java IDE