Program: 34098
Project: 34098
Buggy source:
/** 
 * Add all camera views to the main grid page
 * @param reloadImages reload camera images or not
 * @param showThumbnails show thumbnails that returned by Evercam or not, if trueand if thumbnail not available, it will request latest snapshot instead. If false, it will request neither thumbnail nor latest snapshot.
 */
public boolean addAllCameraViews(final boolean reloadImages,final boolean showThumbnails){
  try {
    camerasPerRow=recalculateCameraPerRow();
    final CustomScrollView scrollView=(CustomScrollView)this.findViewById(R.id.cameras_scroll_view);
    io.evercam.androidapp.custom.FlowLayout camsLineView=(io.evercam.androidapp.custom.FlowLayout)this.findViewById(R.id.cameras_flow_layout);
    final Rect bounds=readLiveBoundsOfScrollView();
    int screen_width=readScreenWidth(this);
    int index=0;
    totalCamerasInGrid=0;
    for (    EvercamCamera evercamCamera : AppData.evercamCameraList) {
      final LinearLayout cameraListLayout=new LinearLayout(this);
      int indexPlus=index + 1;
      if (reloadImages)       evercamCamera.loadingStatus=ImageLoadingStatus.not_started;
      final CameraLayout cameraLayout=new CameraLayout(this,evercamCamera,showThumbnails);
      LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(android.view.ViewGroup.LayoutParams.WRAP_CONTENT,android.view.ViewGroup.LayoutParams.WRAP_CONTENT);
      params.width=((indexPlus % camerasPerRow == 0) ? (screen_width - (index % camerasPerRow) * (screen_width / camerasPerRow)) : screen_width / camerasPerRow);
      params.width=params.width - 1;
      params.height=(int)(params.width / (1.25));
      params.setMargins(1,1,0,0);
      cameraLayout.setLayoutParams(params);
      cameraListLayout.addView(cameraLayout);
      camsLineView.addView(cameraListLayout,new io.evercam.androidapp.custom.FlowLayout.LayoutParams(0,0));
      index++;
      if (reloadImages) {
        new Handler().postDelayed(new Runnable(){
          @Override public void run(){
            Rect cameraBounds=new Rect();
            cameraListLayout.getHitRect(cameraBounds);
            if (Rect.intersects(cameraBounds,bounds)) {
              cameraLayout.loadImage();
            }
          }
        }
,300);
      }
      totalCamerasInGrid++;
    }
    if (this.getActionBar() != null)     this.getActionBar().setHomeButtonEnabled(true);
    if (refresh != null)     refresh.setActionView(null);
    if (reloadImages) {
      setScrollStopListenerFor(scrollView);
    }
    return true;
  }
 catch (  Exception e) {
    Log.e(TAG,e.toString(),e);
    if (Constants.isAppTrackingEnabled) {
      BugSenseHandler.sendException(e);
    }
    EvercamPlayApplication.sendEventAnalytics(this,R.string.category_error,R.string.action_error_camera_list,R.string.label_error_add_cameras);
    EvercamPlayApplication.sendCaughtException(this,e);
    CustomedDialog.showUnexpectedErrorDialog(CamerasActivity.this);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Add all camera views to the main grid page
 * @param reloadImages reload camera images or not
 * @param showThumbnails show thumbnails that returned by Evercam or not, if trueand if thumbnail not available, it will request latest snapshot instead. If false, it will request neither thumbnail nor latest snapshot.
 */
public boolean addAllCameraViews(final boolean reloadImages,final boolean showThumbnails){
  try {
    camerasPerRow=recalculateCameraPerRow();
    final CustomScrollView scrollView=(CustomScrollView)this.findViewById(R.id.cameras_scroll_view);
    io.evercam.androidapp.custom.FlowLayout camsLineView=(io.evercam.androidapp.custom.FlowLayout)this.findViewById(R.id.cameras_flow_layout);
    final Rect bounds=readLiveBoundsOfScrollView();
    int screen_width=readScreenWidth(this);
    int index=0;
    totalCamerasInGrid=0;
    Log.d(TAG,"String_Node_Str" + AppData.evercamCameraList.size());
    for (    EvercamCamera evercamCamera : AppData.evercamCameraList) {
      final LinearLayout cameraListLayout=new LinearLayout(this);
      int indexPlus=index + 1;
      if (reloadImages)       evercamCamera.loadingStatus=ImageLoadingStatus.not_started;
      final CameraLayout cameraLayout=new CameraLayout(this,evercamCamera,showThumbnails);
      LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(android.view.ViewGroup.LayoutParams.WRAP_CONTENT,android.view.ViewGroup.LayoutParams.WRAP_CONTENT);
      params.width=((indexPlus % camerasPerRow == 0) ? (screen_width - (index % camerasPerRow) * (screen_width / camerasPerRow)) : screen_width / camerasPerRow);
      params.width=params.width - 1;
      params.height=(int)(params.width / (1.25));
      params.setMargins(1,1,0,0);
      cameraLayout.setLayoutParams(params);
      cameraListLayout.addView(cameraLayout);
      camsLineView.addView(cameraListLayout,new io.evercam.androidapp.custom.FlowLayout.LayoutParams(0,0));
      index++;
      if (reloadImages) {
        new Handler().postDelayed(new Runnable(){
          @Override public void run(){
            Rect cameraBounds=new Rect();
            cameraListLayout.getHitRect(cameraBounds);
            if (Rect.intersects(cameraBounds,bounds)) {
              cameraLayout.loadImage();
            }
          }
        }
,300);
      }
      totalCamerasInGrid++;
    }
    if (this.getActionBar() != null)     this.getActionBar().setHomeButtonEnabled(true);
    if (refresh != null)     refresh.setActionView(null);
    if (reloadImages) {
      setScrollStopListenerFor(scrollView);
    }
    return true;
  }
 catch (  Exception e) {
    Log.e(TAG,e.toString(),e);
    if (Constants.isAppTrackingEnabled) {
      BugSenseHandler.sendException(e);
    }
    EvercamPlayApplication.sendEventAnalytics(this,R.string.category_error,R.string.action_error_camera_list,R.string.label_error_add_cameras);
    EvercamPlayApplication.sendCaughtException(this,e);
    CustomedDialog.showUnexpectedErrorDialog(CamerasActivity.this);
  }
  return false;
}