Example usage for android.app DownloadManager ACTION_VIEW_DOWNLOADS

List of usage examples for android.app DownloadManager ACTION_VIEW_DOWNLOADS

Introduction

In this page you can find the example usage for android.app DownloadManager ACTION_VIEW_DOWNLOADS.

Prototype

String ACTION_VIEW_DOWNLOADS

To view the source code for android.app DownloadManager ACTION_VIEW_DOWNLOADS.

Click Source Link

Document

Intent action to launch an activity to display all downloads.

Usage

From source file:dentex.youtube.downloader.ShareActivity.java

public static void NotificationHelper() {
    pt1 = mContext.getString(R.string.notification_downloading_pt1);
    pt2 = mContext.getString(R.string.notification_downloading_pt2);
    noDownloads = mContext.getString(R.string.notification_no_downloads);

    mBuilder = new NotificationCompat.Builder(mContext);

    mBuilder.setSmallIcon(R.drawable.ic_stat_ytd)
            .setContentTitle(mContext.getString(R.string.title_activity_share))
            .setContentText(mContext.getString(R.string.notification_downloading_pt1) + " " + sequence.size()
                    + " " + mContext.getString(R.string.notification_downloading_pt2));

    mNotificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);

    Intent notificationIntent = new Intent(android.app.DownloadManager.ACTION_VIEW_DOWNLOADS);
    if (notificationIntent.resolveActivity(mContext.getPackageManager()) != null) {
        notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
    } else {//from w  ww. j  av a  2  s .c om
        Log.e(DEBUG_TAG, "notificationIntent not resolved");
    }
    PendingIntent contentIntent = PendingIntent.getActivity(mContext, 0, notificationIntent, 0);
    mBuilder.setContentIntent(contentIntent);
    mId = 1;
    mNotificationManager.notify(mId, mBuilder.build());
}

From source file:com.becapps.easydownloader.ShareActivity.java

public static void NotificationHelper() {
    pt1 = mContext.getString(R.string.notification_downloading_pt1);
    pt2 = mContext.getString(R.string.notification_downloading_pt2);
    noDownloads = mContext.getString(R.string.notification_no_downloads);

    mBuilder = new NotificationCompat.Builder(mContext);

    mBuilder.setSmallIcon(R.drawable.icon_nb).setContentTitle(mContext.getString(R.string.title_activity_share))
            .setContentText(mContext.getString(R.string.notification_downloading_pt1) + " " + sequence.size()
                    + " " + mContext.getString(R.string.notification_downloading_pt2));

    mNotificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);

    Intent notificationIntent = new Intent(android.app.DownloadManager.ACTION_VIEW_DOWNLOADS);
    if (notificationIntent.resolveActivity(mContext.getPackageManager()) != null) {
        notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
    } else {/* www. j  a  va 2 s .  c o m*/
        Log.e(DEBUG_TAG, "notificationIntent not resolved");
    }
    PendingIntent contentIntent = PendingIntent.getActivity(mContext, 0, notificationIntent, 0);
    mBuilder.setContentIntent(contentIntent);
    mId = 1;
    mNotificationManager.notify(mId, mBuilder.build());
}