fix crash when switching activities while downloading offline stuff
This commit is contained in:
parent
cf39cea333
commit
282285ef78
@ -464,15 +464,23 @@ public class OfflineDownloadService extends Service {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStart(Intent intent, int startId) {
|
public void onStart(Intent intent, int startId) {
|
||||||
m_sessionId = intent.getStringExtra("sessionId");
|
try {
|
||||||
|
if (getWritableDb().isDbLockedByCurrentThread() || getWritableDb().isDbLockedByOtherThreads()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!m_downloadInProgress) {
|
m_sessionId = intent.getStringExtra("sessionId");
|
||||||
if (m_downloadImages) ImageCacheService.cleanupCache(false);
|
|
||||||
|
|
||||||
updateNotification(R.string.notify_downloading_init);
|
if (!m_downloadInProgress) {
|
||||||
m_downloadInProgress = true;
|
if (m_downloadImages) ImageCacheService.cleanupCache(false);
|
||||||
|
|
||||||
downloadCategories();
|
updateNotification(R.string.notify_downloading_init);
|
||||||
|
m_downloadInProgress = true;
|
||||||
|
|
||||||
|
downloadCategories();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user