Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App not receiving android.intent.action.DOWNLOAD_COMPLETE intent

I am writing a simple app that would get notified when any download via the Download manager is completed on the android device. I have created a Broadcast Receiver for the same and set the intent filter as below in my Manifest file. However my broadcast receiver does not get invoked when download is completed . Is there some other permissions that I need to set as well so that my app receives the DOWNLOAD_COMPLETE intent sent by the Download Manager ? Please note : my app needs to listen to any download that is completed via the Download Manager

<receiver
    android:name="com.example.filedownload.Downloadlistener" >
       <intent-filter>
        <action android:name="android.intent.action.DOWNLOAD_COMPLETE" />
        <action android:name="android.intent.action.DOWNLOAD_NOTIFICATION_CLICKED" />
       </intent-filter>
</receiver>

Following are the permissions used :

<uses-permission android:name="android.permission.INTERNET" />
 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
like image 761
sim Avatar asked Apr 16 '13 16:04

sim


3 Answers

I did finally manage to fix this issue by adding the following permission to my manifest:

<uses-permission android:name="android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS" />
like image 58
Erwan Avatar answered Nov 19 '22 02:11

Erwan


Is your BroadcastReceiver really called com.example.filedownload.Downloadlistener? You probably need to change it to match the actual name.

like image 1
Graham Borland Avatar answered Nov 19 '22 00:11

Graham Borland


Late to the party, but got a chance to look into the source code for the download manager, and it seems that the Download Complete broadcast is targeted at the app that initiated the download, so it seems you can't catch other apps' downloads...

like image 1
PerplexedGuide Avatar answered Nov 19 '22 02:11

PerplexedGuide