I have seen this and similar posts.
To me it seems that I do everything correctly.
Still,
SupportMapFragment mapFrag = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);`
returns NULL.
activty_map.xml
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.SupportMapFragment"
/>
<Button
android:id="@+id/startgeo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Set Geo"
android:background="@android:color/transparent"
android:layout_gravity="right"/>
</FrameLayout>
Code in my Activity:
setContentView(R.layout.activty_map);
SupportMapFragment mapFrag = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map); //RETURNS NULL !!!
map = mapFrag.getMap();