@Override
 public void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   outState.putParcelable(FileDownloadFragment.EXTRA_FILE, getFile());
   outState.putParcelable(FileDownloadFragment.EXTRA_ACCOUNT, mAccount);
   outState.putBoolean(FileDownloadFragment.EXTRA_ERROR, mError);
 }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);

    if (savedInstanceState != null) {
      if (!mIgnoreFirstSavedState) {
        setFile((OCFile) savedInstanceState.getParcelable(FileDownloadFragment.EXTRA_FILE));
        mAccount = savedInstanceState.getParcelable(FileDownloadFragment.EXTRA_ACCOUNT);
        mError = savedInstanceState.getBoolean(FileDownloadFragment.EXTRA_ERROR);
      } else {
        mIgnoreFirstSavedState = false;
      }
    }

    View view = null;
    view = inflater.inflate(R.layout.file_download_fragment, container, false);
    mView = view;

    ProgressBar progressBar = (ProgressBar) mView.findViewById(R.id.progressBar);
    mProgressListener = new ProgressListener(progressBar);

    ((ImageButton) mView.findViewById(R.id.cancelBtn)).setOnClickListener(this);

    if (mError) {
      setButtonsForRemote();
    } else {
      setButtonsForTransferring();
    }

    return view;
  }
 /** {@inheritDoc} */
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   if (mAccount != null) {
     // mStorageManager = new FileDataStorageManager(mAccount,
     // getActivity().getApplicationContext().getContentResolver());;
   }
 }
  /** {@inheritDoc} */
  @Override
  public void onAttach(Activity activity) {
    super.onAttach(activity);
    try {
      mContainerActivity = (ContainerActivity) activity;

    } catch (ClassCastException e) {
      throw new ClassCastException(
          activity.toString()
              + " must implement "
              + FileFragment.ContainerActivity.class.getSimpleName());
    }
  }
 @Override
 public void onDestroy() {
   super.onDestroy();
 }
 @Override
 public void onStop() {
   super.onStop();
   leaveTransferProgress();
 }
 @Override
 public void onPause() {
   super.onPause();
 }
 @Override
 public void onResume() {
   super.onResume();
 }
 @Override
 public void onStart() {
   super.onStart();
   listenForTransferProgress();
 }
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
 }