public void createFile(File f) {
   // Create and show the dialog.
   AddContentDialogFragment newFragment =
       AddContentDialogFragment.newInstance(importFolder, f, (createFile != null));
   newFragment.show(getActivity().getFragmentManager(), AddContentDialogFragment.TAG);
   tmpFile = null;
   createFile = null;
 }
  public void createFile(File f) {
    FragmentTransaction ft = getFragmentManager().beginTransaction();
    Fragment prev = getFragmentManager().findFragmentByTag(AddContentDialogFragment.TAG);
    if (prev != null) {
      ft.remove(prev);
    }

    // Create and show the dialog.
    AddContentDialogFragment newFragment = AddContentDialogFragment.newInstance(importFolder, f);

    newFragment.show(ft, AddContentDialogFragment.TAG);
    tmpFile = null;
  }