How to open downloads app in android after clicking on notification using DownloadManager

1.2k views Asked by At

Here i used DownloadManger to download and it will show the progress in Notification bar

DownloadManager.Request request = new DownloadManager.Request(uri);
            request.setTitle("Data Download");
            //Setting description of request
            request.setDescription("Android Data download using DownloadManager.");
            request.allowScanningByMediaScanner();
            request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);

registerReceiver(downloadReceiver, filter);

Broadcast receiver to receive click action(DownloadManager.ACTION_NOTIFICATION_CLICKED) during downloading and the action is working during download

private BroadcastReceiver downloadReceiver = new BroadcastReceiver() {

        @Override
        public void onReceive(Context context, Intent intent) {



            String action = intent.getAction();

            if (DownloadManager.ACTION_NOTIFICATION_CLICKED.equals(action))
            {
               startActivity(new Intent(DownloadManager.ACTION_VIEW_DOWNLOADS));
            }


        }
    };

but after download DownloadManager.ACTION_NOTIFICATION_CLICKED is not working to redirect to downloads app. Can any one help me how can i redirect after clicking on DownloadManger notification(after complete download) to downloads app ????????????

0

There are 0 answers