Fix exception when cancelling dl within app#18
Closed
errietta wants to merge 7 commits into
Closed
Conversation
Errietta patch 1
|
Hi, any updates about this? Any plans to merge? |
Author
|
..? |
|
I mean when this fix will be merged? has the same error, when doing cancel download, app simple crush :( |
Author
|
@sgrebnov ? (I think I need to tidy up the PR but they should let me know 👅 ) |
Author
|
Moved the crash-fixing code in its own PR cause this has irrelevant commits - #24 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
this may not be an ideal fix, but my app crashed when cancelling a dl..
Probably an issue with the dl removed from the list before the reciever callback is called. I traced the issue down to
android.app.DownloadManager$CursorTranslator.getString(DownloadManager.java:1396)
at org.apache.cordova.backgroundDownload.BackgroundDownload$2.onReceive(BackgroundDownload.java:360)
Bellow is full stacktrace
12-26 12:58:46.122 19200-19200/com.theyeshiva.app E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.theyeshiva.app, PID: 19200
java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.DOWNLOAD_COMPLETE flg=0x10 pkg=com.theyeshiva.app (has extras) } in org.apache.cordova.backgroundDownload.BackgroundDownload$2@2796b593
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:915)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5691)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)
Caused by: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
at android.database.AbstractCursor.checkPosition(AbstractCursor.java:426)
at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:151)
at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:65)
at android.database.CursorWrapper.getString(CursorWrapper.java:114)
at android.database.CursorWrapper.getString(CursorWrapper.java:114)
at android.app.DownloadManager$CursorTranslator.getString(DownloadManager.java:1396)
at org.apache.cordova.backgroundDownload.BackgroundDownload$2.onReceive(BackgroundDownload.java:360)
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:905)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5691)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)