package com.novoda.downloadmanager.demo.extended;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.util.Log;
import android.widget.Toast;

import com.novoda.downloadmanager.lib.DownloadManager;

public class DownloadBatchCompletionReceiver extends BroadcastReceiver {

    private static final int UNKNOWN_BATCH_ID = -1;
    private static final String TAG = DownloadBatchCompletionReceiver.class.getSimpleName();

    @Override
    public void onReceive(@NonNull Context context, @NonNull Intent intent) {
        if (DownloadManager.ACTION_BATCH_COMPLETE.equals(intent.getAction())) {
            long batchId = intent.getLongExtra(DownloadManager.EXTRA_BATCH_ID, UNKNOWN_BATCH_ID);
            Toast.makeText(context, "Batch completed with id: " + batchId, Toast.LENGTH_SHORT).show();
            Log.d(TAG, "Batch completed: " + batchId);
        }
    }

}

@@ -619,92 +619,8 @@
 ) %7B%0A
-        if (DownloadManager.ACTION_BATCH_COMPLETE.equals(intent.getAction())) %7B%0A    
     
@@ -709,20 +709,16 @@
 CH_ID);%0A
-    
         
@@ -816,20 +816,16 @@
         
-  
-  
 Log.d(TA
@@ -863,18 +863,8 @@
 d);%0A
-        %7D%0A
     

Remove unnecessary if statement