Code example for Fragment

Methods: getActivity, getFragmentManager

0
		@Override 
		protected void onPostExecute(Boolean result) {
			super.onPostExecute(result);
			AndroidLogWrapper.d(OpenRocketSaverFragment.class,"Finished saving " + OpenRocketSaverTask.this);
			if ( showProgressDialog ) {
				Fragment progress = getActivity().getSupportFragmentManager().findFragmentByTag(PROGRESS_DIALOG_TAG);
				if ( progress != null ) {
					// Remove the fragment instead of trying to use DialogFragment.dismiss. 
					// If the dialog is now currently shown, dismiss fails. 
					getFragmentManager().beginTransaction().remove(progress).commitAllowingStateLoss();
				} 
			} else { 
				((SherlockFragmentActivity)getActivity()).setSupportProgress(Window.PROGRESS_END);
				((SherlockFragmentActivity)getActivity()).setSupportProgressBarVisibility(false);
			} 
			if ( listener != null ) {
				listener.onOpenRocketFileSaved(result);
			} 
		} 
 
	}