I'm using MapFragment, my activity layout is it:
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/actionbar" />
If I want to move map camera using CameraUpdateFactory.newLatLngBounds(LatLngBounds, padding)
I get this error:
Map size can't be 0. Most likely, layout has not yet occured for the map view. Either wait until layout has occurred or use newLatLngBounds(LatLngBounds, int, int, int) which allows you to specify the map's dimensions.
Is there an event listener if the map has measured?
EDIT1: @raz that is the code where I retrieve the map fragment:
if (googleMap == null) {
googleMap = ((MapFragment) getFragmentManager().findFragmentById(
R.id.map)).getMap();
}