-
Notifications
You must be signed in to change notification settings - Fork 95
Open
Description
[ERROR]
Caused by java.lang.IllegalStateException
Not allowed to start service Intent { cmp=net.instiz.www.instiz/com.ixuea.android.downloader.DownloadService }: app is in background uid UidRecord{848d58 u0a186 SVC idle change:idle|uncached procs:1 proclist:32669, seq(0,0,0)}
[ Code ] DownloadService.java
public static DownloadManager getDownloadManager(Context context, Config config) {
if (!isServiceRunning(context)) {
Intent downloadSvr = new Intent(context, DownloadService.class);
context.startService(downloadSvr); //<---- This is Code Line 31
}
if (DownloadService.downloadManager == null) {
DownloadService.downloadManager = DownloadManagerImpl.getInstance(context, config);
}
return downloadManager;
}
[Suggest & How to Solve ]
DownloadService.java - getDownloadManager() -31 Line, It needs to be divided
When running the service on Android 8.0
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.startForegroundService(downloadSvr);
} else {
context.startService(downloadSvr);
}
Metadata
Metadata
Assignees
Labels
No labels