Pongo código y así despejamos dudas:
Código:
<!-- Layout principal -->
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ListView
android:id="@+id/left_drawer"
android:layout_width="300dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#585858"
android:choiceMode="singleChoice" />
</android.support.v4.widget.DrawerLayout>
Código:
//Actividad principal
public class MainActivity extends Activity implements OnItemClickListener {
// Variables miembro.
private Fragment mContent;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (mContent == null)
mContent = new Fragment_localizacion();
getFragmentManager()
.beginTransaction()
.replace(R.id.content_frame, mContent).commit();
......
Código:
//Fragment del mapa
public class Fragment_localizacion extends FragmentActivity {
private GoogleMap mapa;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mi_localizacion);
mapa = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
mapa.setMapType(GoogleMap.MAP_TYPE_NORMAL);
mapa.setMyLocationEnabled(true);
mapa.getUiSettings().setZoomControlsEnabled(false);
mapa.getUiSettings().setCompassEnabled(true);
mapa.getMyLocation();
}