diff --git a/app/build.gradle b/app/build.gradle index ead5dfc30..a1f8746b0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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" diff --git a/app/src/main/java/com/seafile/seadroid2/editor/EditorActivity.java b/app/src/main/java/com/seafile/seadroid2/editor/EditorActivity.java index 8dca7d29a..191a67fae 100644 --- a/app/src/main/java/com/seafile/seadroid2/editor/EditorActivity.java +++ b/app/src/main/java/com/seafile/seadroid2/editor/EditorActivity.java @@ -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; @@ -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"); + } + } }