Code example for Fragment

Methods: onSaveInstanceState

     * 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);
     * Sets the photo for this Fragment, by storing a URL that points to a picture 
     * @param urlString A String representation of the URL pointing to the picture 
    public void setPhoto(String urlString) {
        mURLString = urlString;