Code example for Fragment

Methods: onDetach

        // Removes the reference to the URL 
        mURLString = null;
        // Always call the super method last 
     * This callback is invoked if the system asks the Fragment to save its state. This allows the 
     * the system to restart the Fragment later on. 
    public void onSaveInstanceState(Bundle bundle) {
        // Always call the super method first 
        // Puts the current URL for the picture being shown into the saved state 
        bundle.putString(PHOTO_URL_KEY, mURLString);