Commit 6fbed2e6 authored by fallenstardust's avatar fallenstardust

收藏夹mList为空时不保存只重载

parent 8afcfcbb
......@@ -87,15 +87,19 @@ public class CardFavorites {
mList.add(Integer.parseInt(tmp));
}
}
Log.d(TAG, "load favorites success:"+mList.size());
Log.d(TAG, "load favorites success:" + mList.size());
}
public void save() {
List<String> ret = new ArrayList<>();
if (!mList.isEmpty()) {
for (Integer id : mList) {
ret.add(String.valueOf(id));
}
File conf = AppsSettings.get().getSystemConfig();
FileUtils.writeLines(conf.getPath(), ret, Constants.DEF_ENCODING, "\n");
} else {
load();
}
}
}
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