I have a layout that actually shows the map on the app
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/fragment_create_instant_album_create_button_text_view" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="vertical"
android:paddingLeft="30dp"
android:paddingRight="30dp" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:text="@string/instant_album_info"
android:textColor="@color/pico_clay" />
<EditText
android:id="@+id/fragment_create_instant_album_album_name_text_view"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="15dp"
android:background="@drawable/blue_border_edittext_unselected"
android:hint="@string/album_name"
android:paddingLeft="15dp"
android:textColor="@color/pico_dark_grey"
android:textColorHint="@color/pico_grey_blue"
android:textSize="@dimen/text_medium" />
<fragment
android:id="@+id/fragment_create_instant_album_map_fragment"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_marginTop="15dp"
class="com.google.android.gms.maps.SupportMapFragment"
android:background="@drawable/blue_border_edittext_unselected"
android:paddingBottom="8dp"
android:paddingTop="8dp"
android:tag="map" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:gravity="center_vertical"
android:paddingTop="8dp" >
<RadioGroup
android:id="@+id/fragment_create_instant_album_privacy_radio_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
</RadioGroup>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<com.coapps.pico.fonts.RobotoTextView
android:id="@+id/fragment_create_instant_album_create_button_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/pico_salmon"
android:gravity="center"
android:paddingBottom="20dp"
android:paddingTop="20dp"
android:text="@string/create_instant_album"
android:textAppearance="@android:style/TextAppearance.Large"
android:textColor="@android:color/white" />
</RelativeLayout>
but when using this code to get the map fragment, it always return null (although I'm seeing the map)
albumName = (TextView) view
.findViewById(R.id.fragment_create_instant_album_album_name_text_view);
createAlbum = (TextView) view
.findViewById(R.id.fragment_create_instant_album_create_button_text_view);
mapFragment = (SupportMapFragment) mainActivity.getSupportFragmentManager().findFragmentByTag("map");
Why? What am I doing wrong?