public static boolean isNetworkChanged(Context context,String prevConnectivityType,String mPrevConnectionSubType){
  String connectivityType=getNetworkType(context);
  String connectivitySubType=getNetworkSubType(context);
  if (null == prevConnectivityType) {
    return false;
  }
 else   if (!prevConnectivityType.equals(connectivityType)) {
    return true;
  }
 else   if (!mPrevConnectionSubType.equals(connectivitySubType)) {
    return true;
  }
  return false;
}

public static boolean isNetworkChanged ( Context context , String prevConnectivityType , String mPrevConnectionSubType ) { String connectivityType = getNetworkType ( context ) ; String connectivitySubType = getNetworkSubType ( context ) ; if ( null == prevConnectivityType ) { return false ; } else if ( ! prevConnectivityType . equals ( connectivityType ) ) { return true ; } else if ( ! mPrevConnectionSubType . equals ( connectivitySubType ) ) { return true ; } return false ; }
check if network connection has changed
