Ejemplo n.º 1
0
  private void startImport(String path, Importer importer) {
    String sdCard = ExternalStorage.getSdCardPath(this);
    if (sdCard == null) {
      reportError(getResources().getString(R.string.service_dataimport_error_nosd));
      return;
    }

    File doc = new File(sdCard + path);
    if (!doc.exists() || !doc.isFile() || !doc.canRead()) {
      reportError(getResources().getString(R.string.service_dataimport_error_notfound));
      return;
    }

    processFile(doc, importer);
  }