Commit b5558583 authored by xiaoye's avatar xiaoye

fix

parent e2a824ae
...@@ -1603,6 +1603,7 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte ...@@ -1603,6 +1603,7 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte
boolean ret = ydk.createNewFile(); boolean ret = ydk.createNewFile();
} catch (Throwable ignore) { } catch (Throwable ignore) {
} }
//新建卡组保留卡片不保留卡组id
save(ydk, true); save(ydk, true);
loadDeckFromFile(ydk); loadDeckFromFile(ydk);
} }
......
...@@ -117,7 +117,7 @@ class DeckItemUtils { ...@@ -117,7 +117,7 @@ class DeckItemUtils {
* @param file 原有file * @param file 原有file
* @return 如果file为null,返回false * @return 如果file为null,返回false
*/ */
public static boolean save(List<DeckItem> items, String deck_id, File file) { public static boolean save(List<DeckItem> items, String deckId, File file) {
FileOutputStream outputStream = null; FileOutputStream outputStream = null;
OutputStreamWriter writer = null; OutputStreamWriter writer = null;
try { try {
...@@ -164,8 +164,8 @@ class DeckItemUtils { ...@@ -164,8 +164,8 @@ class DeckItemUtils {
writer.write(("\n" + cardInfo.Code).toCharArray()); writer.write(("\n" + cardInfo.Code).toCharArray());
} }
} }
if (deck_id != null) if (deckId != null)
writer.write(("\n##" + deck_id).toCharArray()); writer.write(("\n##" + deckId).toCharArray());
writer.flush(); writer.flush();
outputStream.flush(); outputStream.flush();
} catch (IOException e) { } catch (IOException e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment