protected void updateProgressNotification ( @ NonNull final NotificationCompat . Builder builder , final int progress ) { // Add Abort action to the notification if ( progress != PROGRESS_ABORTED && progress != PROGRESS_COMPLETED ) { final Intent abortIntent = new Intent ( BROADCAST_ACTION ) ; abortIntent . putExtra ( EXTRA_ACTION , ACTION_ABORT ) ; final PendingIntent pendingAbortIntent = PendingIntent . getBroadcast ( this , 1 , abortIntent , PendingIntent . FLAG_UPDATE_CURRENT ) ; builder . addAction ( R . drawable . ic_action_notify_cancel , getString ( R . string . dfu_action_abort ) , pendingAbortIntent ) ; } }
This method allows you to update the notification showing the upload progress .