コード例 #1
0
  @Override
  public void onQueryComplete(List result) {
    FileData<ChineseToEnglishCard> fileData = getFileData();
    fileData.setData(result);

    FileManager fileManager = new FileManager();
    fileManager.write(fileData);
  }
コード例 #2
0
  private FileData<ChineseToEnglishCard> getFileData() {
    ExcelParams excelParams = new ExcelParams();
    excelParams.setSheet("known words");
    excelParams.setPositionOfSheet(0);

    FileData<ChineseToEnglishCard> fileData = new FileData<>();
    fileData.setExcelParams(excelParams);
    fileData.setDirectory(
        Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).toString());
    fileData.setName("learning_words_backup.xls");

    return fileData;
  }