title: Android set GoolgeMap bounds from database of points
body: <p>Using Google Maps Android API v2, I am trying to set the bounds of the map using <code>LatLngBounds.Builder()</code> with points from a database. I think I am close, however the activity is crashing because I don't think I am properly loading the points. I may be just a couple of lines away.</p>
  
  <pre><code>//setup map
  private void setUpMap() {
  
      //get all cars from the datbase with getter method
      List&lt;Car&gt; K = db.getAllCars();
  
      //loop through cars in the database
      for (Car cn : K) {
  
          //add a map marker for each car, with description as the title using getter methods
          mapView.addMarker(new MarkerOptions().position(new LatLng(cn.getLatitude(), cn.getLongitude())).title(cn.getDescription()));
  
          //use .include to put add each point to be included in the bounds   
          bounds = new LatLngBounds.Builder().include(new LatLng(cn.getLatitude(), cn.getLongitude())).build();
  
         //set bounds with all the map points
         mapView.moveCamera(CameraUpdateFactory.newLatLngBounds(bounds, 50));
      }
  }
  </code></pre>
  
  <p>I think there may be an error in how I arranged the for loop to get all the cars, if I remove the bounds statements the map point are plotted correctly as I expected but not bounding the map properly.</p>