Android Download Listner
<p>Is there any way to find out that the download is successfully or not.
i am using following code to download files from other mobiles phones p2p, but some time other user is out of wifi range. the i wanted to know that the source is out of range so download is not possible at that time.</p>

<p>is there any listener type thing that can help me ?</p>

<pre><code>Uri uri=Uri.parse(downLoadLink);

Environment
  .getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
  .mkdirs();

lastDownload = mgr.enqueue(new DownloadManager.Request(uri)
  .setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI | DownloadManager.Request.NETWORK_MOBILE)
  .setAllowedOverRoaming(false)
  .setTitle(aryToReturn.get(position).name)
  .setDescription("File Downloding...")
  .setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS,aryToReturn.get(position).name));
</code></pre>
