I have a ListView in which each item represents a PDF file. When the user clicks on an item, the application must download the file on external storage. Now the download doe
Please note that DownloadManager.enqueue is asynchronous, it means mgr.enqeue returns almost immediately and after that your current code sets spinner back to invisible.
To hide spinner you have to register a broadcast receiver to receive notification when download completes. You then have to find corresponding spinner and hide it. Please note that download can fail (and notification is still sent in this case).
CommonsWare has posted an example showing how to work with DownloadManager.