更改判断应用前后台状态的实现逻辑

This commit is contained in:
chenjuntao
2020-07-27 17:43:56 +08:00
parent 8b81819c30
commit 3cbd484147
3 changed files with 39 additions and 6 deletions

View File

@ -219,7 +219,7 @@ public class MainActivity extends BaseActivity {
// 必须放在这里,否则会导致获取 baseActivity 不是本应用包名
// postDelayed 是为了让 ProcessLifecycleOwner 知道准确状态,避免调用 startForegroundService
handler.postDelayed(() -> DownloadManager.getInstance(this).initDownloadService(), 0);
DownloadManager.getInstance(this).initDownloadService();
checkNotificationPermission();