完整日志
java.lang.RuntimeException: Unable to start service com.xxx.xxxx.service.DownloadService@41c78ef8 with Intent { cmp=com.xxxx.xxxx/.service.DownloadService (has extras) }: java.lang.IllegalArgumentException: Unknown URL content://downloads/my_downloads
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2746)
at android.app.ActivityThread.access$1900(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1356)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5178)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:561)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalArgumentException: Unknown URL content://downloads/my_downloads
at android.content.ContentResolver.insert(ContentResolver.java:910)
at android.app.DownloadManager.enqueue(DownloadManager.java:935)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2729)
... 10 more
java.lang.IllegalArgumentException: Unknown URL content://downloads/my_downloads
at android.content.ContentResolver.insert(ContentResolver.java:910)
at android.app.DownloadManager.enqueue(DownloadManager.java:935)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2729)
at android.app.ActivityThread.access$1900(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1356)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5178)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:561)
at dalvik.system.NativeStart.main(Native Method)
这是用downloadmanager 来下载更新,出现的bug。
三星手机出现较多。复现规律为:设置----应用管理器----全部----下载管理器----关闭.
没别的好方法,只能捕捉这个异常