title: IllegalStateException: View size is too small after padding
body: <p>I am developing an android app. In this app I am showing a MapView in a fragment. If my device is rotated and I try to move the camera using one of the following methods:</p>
  
  <p><code>mapa.animateCamera(cameraUpdate);</code></p>
  
  <p>or</p>
  
  <p><code>mapa.moveCamera(cameraUpdate);</code></p>
  
  <p>Then my app crashes and shows the following error:</p>
  
  <pre><code>java.lang.IllegalStateException: View size is too small after padding
   at com.google.a.a.ab.b(Unknown Source)
   at com.google.maps.api.android.lib6.gmm6.c.a.a(Unknown Source)
   at com.google.maps.api.android.lib6.gmm6.c.a.a(Unknown Source)
   at com.google.maps.api.android.lib6.d.dw.a(Unknown Source)
   at com.google.maps.api.android.lib6.gmm6.c.a.a(Unknown Source)
   at com.google.maps.api.android.lib6.d.et.a(Unknown Source)
   at com.google.android.gms.maps.internal.j.onTransact(SourceFile:83)
   at android.os.Binder.transact(Binder.java:380)
   at com.google.android.gms.maps.internal.IGoogleMapDelegate$zza$zza.moveCamera(Unknown Source)
   at com.google.android.gms.maps.GoogleMap.moveCamera(Unknown Source)
   at com.accionplus.dbdplus.utils.MapUtils.centrarCamara(MapUtils.java:88)
   at com.accionplus.dbdplus.utils.MapUtils.centrarCamara(MapUtils.java:52)
   at com.accionplus.dbdplus.controladores.pdv.RutaProgramadaFragment$4.onMyLocationButtonClick(RutaProgramadaFragment.java:274)
   at com.google.android.gms.maps.GoogleMap$3.onMyLocationButtonClick(Unknown Source)
   at com.google.android.gms.maps.internal.zzo$zza.onTransact(Unknown Source)
   at android.os.Binder.transact(Binder.java:380)
   at com.google.android.gms.maps.internal.be.a(SourceFile:81)
   at com.google.maps.api.android.lib6.d.ak.onClick(Unknown Source)
   at android.view.View.performClick(View.java:5156)
   at android.view.View$PerformClick.run(View.java:20755)
   at android.os.Handler.handleCallback(Handler.java:739)
   at android.os.Handler.dispatchMessage(Handler.java:95)
   at android.os.Looper.loop(Looper.java:145)
   at android.app.ActivityThread.main(ActivityThread.java:5832)
   at java.lang.reflect.Method.invoke(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:372)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
  </code></pre>
  
  <p>I have googled it but with no success. I just have found that it was a reported issue for google but I do not know if there is any workaround to "solve" this issue. Any one can help me?</p>
  
  <p><strong>EDIT:</strong> I am adding more code</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                  xmlns:tools="http://schemas.android.com/tools"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  tools:context="com.accionplus.dbdplus.controladores.pdv.RutaProgramadaActivity"&gt;
  
      &lt;LinearLayout
          android:id="@+id/card_container"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:background="#15000000"
          android:orientation="vertical"/&gt;
  
      &lt;LinearLayout
          android:id="@+id/filtro_ll"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_below="@+id/card_container"
          android:layout_margin="10dp"
          android:gravity="left|top"
          android:orientation="horizontal"
          android:weightSum="1"&gt;
  
          &lt;LinearLayout
              android:layout_width="0dp"
              android:layout_height="match_parent"
              android:layout_weight="0.7"
              android:gravity="left|top"
              android:orientation="vertical"&gt;
  
              &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:gravity="left"
                  android:orientation="horizontal"
                  android:weightSum="1"&gt;
  
                  &lt;ImageButton
                      android:id="@+id/seleccionar_fecha_btn"
                      android:layout_width="wrap_content"
                      android:layout_height="35dp"
                      android:background="@drawable/button"
                      android:src="@drawable/ic_date"
                      android:text="@string/buscar"
                      android:textColor="@color/color_text_primary"/&gt;
  
                  &lt;TextView
                      android:id="@+id/fecha_consulta_tv"
                      android:layout_width="match_parent"
                      android:layout_height="35dp"
                      android:layout_alignParentTop="true"
                      android:layout_marginLeft="5dp"
                      android:background="@drawable/rectangle"
                      android:gravity="center"/&gt;
              &lt;/LinearLayout&gt;
  
              &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="10dp"
                  android:background="@drawable/rectangle"&gt;
  
                  &lt;Spinner
                      android:id="@+id/tipo_ruta_sp"
                      android:layout_width="fill_parent"
                      android:layout_height="35dp"
                      android:layout_gravity="center"
                      /&gt;
              &lt;/LinearLayout&gt;
  
          &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
  
      &lt;com.google.android.gms.maps.MapView
          android:id="@+id/map"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_below="@+id/filtro_ll"/&gt;
  
      &lt;ProgressBar
          android:id="@+id/progress_bar"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerHorizontal="true"
          android:foregroundGravity="center|top"
          android:visibility="gone"/&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Here's when <code>MyLocationButton</code> is clicked:</p>
  
  <pre><code>mMap.setOnMyLocationButtonClickListener(new GoogleMap.OnMyLocationButtonClickListener() {
              @Override
              public boolean onMyLocationButtonClick() {
                  MapUtils.centrarCamara(getActivity(), mMap, mPuntosFinales);
                  return true;
              }
          });
  </code></pre>
  
  <p>Here's <code>MapUtils.centrarCamara()</code> method:</p>
  
  <pre><code>public static void centrarCamara(Context contexto, GoogleMap mapa, LatLng... posiciones) {
          centrarCamara(contexto, mapa, Boolean.TRUE, posiciones);
      }
  
      public static void centrarCamara(Context contexto, GoogleMap mapa, boolean animado,
                                       LatLng... posiciones) {
          if (mapa == null) {
              return;
          }
  
          LatLngBounds.Builder builder = new LatLngBounds.Builder();
          for (LatLng posicion : posiciones) {
              builder.include(posicion);
          }
  
          LatLngBounds bounds = builder.build();
  
          CameraUpdate cu = CameraUpdateFactory
                  .newLatLngBounds(bounds, ViewUtils.dpAPixeles(MARKERS_DP_OFFSET, contexto));
  
          if (animado) {
              mapa.animateCamera(cu);
          } else {
              mapa.moveCamera(cu);
          }
      }
  </code></pre>
  
  <p>ViewUtils.dpAPixeles:</p>
  
  <pre><code>public static int dpAPixeles(int dp, Context contexto) {
      Resources r = contexto.getResources();
      int px = (int) TypedValue
              .applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, r.getDisplayMetrics());
  
      return px;
  }
  </code></pre>
  
  <p>The exception occurrs when <code>mapa.moveCamera()</code> or <code>mapa.animateCamera()</code> are called;</p>