// Path: app/src/main/java/com/hitanshudhawan/popcorn/utils/NetworkConnection.java
// public class NetworkConnection {
// 
//     public static boolean isConnected(Context context) {
//         ConnectivityManager connectivityManager
//                 = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
//         NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
//         return activeNetworkInfo != null && activeNetworkInfo.isConnected();
//     }
// 
// }


import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.hitanshudhawan.popcorn.utils.NetworkConnection;
package com.hitanshudhawan.popcorn.broadcastreceivers;




/**
 * Created by hitanshu on 26/8/17.
 */

public class ConnectivityBroadcastReceiver extends BroadcastReceiver {

    private ConnectivityReceiverListener mConnectivityReceiverListener;

    public ConnectivityBroadcastReceiver(ConnectivityReceiverListener mConnectivityReceiverListener) {
        this.mConnectivityReceiverListener = mConnectivityReceiverListener;
    }

    @Override
    public void onReceive(Context context, Intent intent) {
// Path: app/src/main/java/com/hitanshudhawan/popcorn/utils/NetworkConnection.java
// public class NetworkConnection {
// 
//     public static boolean isConnected(Context context) {
//         ConnectivityManager connectivityManager
//                 = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
//         NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
//         return activeNetworkInfo != null && activeNetworkInfo.isConnected();
//     }
// 
// }


// Path: app/src/main/java/com/hitanshudhawan/popcorn/broadcastreceivers/ConnectivityBroadcastReceiver.java
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.hitanshudhawan.popcorn.utils.NetworkConnection;

package com.hitanshudhawan.popcorn.broadcastreceivers;




/**
 * Created by hitanshu on 26/8/17.
 */

public class ConnectivityBroadcastReceiver extends BroadcastReceiver {

    private ConnectivityReceiverListener mConnectivityReceiverListener;

    public ConnectivityBroadcastReceiver(ConnectivityReceiverListener mConnectivityReceiverListener) {
        this.mConnectivityReceiverListener = mConnectivityReceiverListener;
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        if (mConnectivityReceiverListener != null && NetworkConnection.isConnected(context))