@Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   if (getArguments() != null) {
     adjustments = (ArrayList<Adjustment>) getArguments().getSerializable(ADJUSTMENTS);
   }
 }
Beispiel #2
0
 @Override
 public void onCreate(Bundle bundle) {
   super.onCreate(bundle);
   Bundle args = this.getArguments();
   dbPath = args.getString(EXTRA_DBPATH);
   setStyle(DialogFragment.STYLE_NO_TITLE, 0);
 }
Beispiel #3
0
  @Override
  public void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    Bundle args = this.getArguments();
    if (args != null) {
      defaultRoot = args.getString(EXTRA_DEFAULT_ROOT);
      String ext = args.getString(EXTRA_FILE_EXTENSIONS);
      // Default do not dismiss the dialog
      dismissOnSelect = args.getBoolean(EXTRA_DISMISS_ON_SELECT, false);

      if (ext != null) {
        fileExtensions = ext.split(",");
      } else {
        fileExtensions = new String[] {".db"};
      }
    } else {
      fileExtensions = new String[] {".db"};
      defaultRoot = null;
    }
    if (defaultRoot == null) {
      defaultRoot = settings.getString(AMPrefKeys.SAVED_FILEBROWSER_PATH_KEY, null);

      // Make sure the path exists.
      if (!Strings.isNullOrEmpty(defaultRoot) && !new File(defaultRoot).exists()) {
        defaultRoot = null;
      }
    }

    if (Strings.isNullOrEmpty(defaultRoot)) {
      File sdPath = new File(AMEnv.DEFAULT_ROOT_PATH);
      sdPath.mkdir();

      currentDirectory = sdPath;
    } else {
      currentDirectory = new File(defaultRoot + "/");
    }

    // Should use this to enable menu
    setHasOptionsMenu(true);
  }