Skip to content

Commit

Permalink
FileMonitorService is not running, start it in EditorActivity (#908)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxiaoping authored Aug 23, 2021
1 parent 4ea33de commit 034ced8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId 'com.seafile.seadroid2'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 114
versionName "2.2.39"
versionCode 115
versionName "2.2.40"
multiDexEnabled true
resValue "string", "authorities", applicationId + '.cameraupload.provider'
resValue "string", "account_type", "com.seafile.seadroid2.account.api2"
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/java/com/seafile/seadroid2/editor/EditorActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
import com.seafile.seadroid2.R;
import com.seafile.seadroid2.SeafException;
import com.seafile.seadroid2.editor.widget.HorizontalEditScrollView;
import com.seafile.seadroid2.monitor.FileMonitorService;
import com.seafile.seadroid2.ui.activity.BaseActivity;
import com.seafile.seadroid2.ui.dialog.FileSaveTaskDialog;
import com.seafile.seadroid2.ui.dialog.TaskDialog;
import com.seafile.seadroid2.util.Utils;
import com.yydcdut.markdown.MarkdownConfiguration;
import com.yydcdut.markdown.MarkdownEditText;
import com.yydcdut.markdown.MarkdownProcessor;
Expand Down Expand Up @@ -186,4 +188,14 @@ public void onTaskFailed(SeafException e) {
});
dialog.show(getSupportFragmentManager(), "FileSaveTaskDialog");
}

@Override
protected void onResume() {
super.onResume();
if (!com.seafile.seadroid2.util.Utils.isServiceRunning(EditorActivity.this, "com.seafile.seadroid2.monitor.FileMonitorService")) {
Intent monitorIntent = new Intent(EditorActivity.this, FileMonitorService.class);
EditorActivity.this.startService(monitorIntent);
Utils.utilsLogInfo(true, "---------FileMonitorService is not running, start it in EditorActivity");
}
}
}

0 comments on commit 034ced8

Please sign in to comment.