Code example for Intent

Methods: getActiongetBooleanExtra

0
    }; 
 
    private final BroadcastReceiver mUpdateLocationReceiver = new BroadcastReceiver() {
        @Override 
        public void onReceive(Context context, Intent intent) { 
            if (Intent.ACTION_AIRPLANE_MODE_CHANGED.equals(intent.getAction()) 
                    && !intent.getBooleanExtra("state", false)) { 
                // Airplane mode is now off! 
                mLocationHandler.requestLocationUpdate(); 
                return; 
            } 
 
            // Time zone has changed or alarm expired. 
            mLocationHandler.requestTwilightUpdate(); 
        } 
    }; 
 
    // A LocationListener to initialize the network location provider. The location updates 
    // are handled through the passive location provider. 
    private final LocationListener mEmptyLocationListener =  new LocationListener() {
        public void onLocationChanged(Location location) {