Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
fix an error
Browse files Browse the repository at this point in the history
  • Loading branch information
zsakvo committed Dec 8, 2018
1 parent e44ce18 commit f8c77b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private String cleanSource(String s){
public void onStart(){
super.onStart();
getPreferenceScreen().removeAll();
autoMerge = cha.getSharedPreferences("settings",MODE_PRIVATE).getBoolean("cs_auto_merge",true);
autoMerge = cha.getSharedPreferences("settings",MODE_PRIVATE).getBoolean("cs_auto_merge",false);
getBooksCache();
}

Expand Down
13 changes: 11 additions & 2 deletions app/src/main/java/cc/zsakvo/yueduhchelper/task/WriteFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

import cc.zsakvo.yueduhchelper.listener.WriteFileListener;

Expand All @@ -18,7 +19,7 @@ public WriteFile(WriteFileListener wfl){

@SuppressWarnings("ResultOfMethodCallIgnored")
private void makeFilePath(String filePath, String fileName) {
File file = null;
File file;
makeRootDirectory(filePath);
try {
file = new File(filePath + fileName);
Expand All @@ -34,7 +35,7 @@ private void makeFilePath(String filePath, String fileName) {

@SuppressWarnings("ResultOfMethodCallIgnored")
private static void makeRootDirectory(String filePath) {
File file = null;
File file;
try {
file = new File(filePath);
if (!file.exists()) {
Expand All @@ -56,6 +57,14 @@ protected Boolean doInBackground(String... strings) {
}
catch(Exception e){
e.printStackTrace();
try {
makeFilePath(strings[1],"log");
FileOutputStream fos = new FileOutputStream(strings[1]);
fos.write(e.toString().getBytes());
fos.close();
} catch (IOException e1) {
e1.printStackTrace();
}
return false;
}
return true;
Expand Down

0 comments on commit f8c77b2

Please sign in to comment.