Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/03/2015, 10:06
Xpak
 
Fecha de Ingreso: junio-2014
Mensajes: 25
Antigüedad: 9 años, 10 meses
Puntos: 0
getFragmentManager a fragment

Buenas intento transformar un activity a un fragment para usar un slidingmenu y tengo problemas con getFragmentManager , espero que me puedan ayudar...he buscado por todos lados

mi xml file:

Código XML:
Ver original
  1. <fragment xmlns:android="http://schemas.android.com/apk/res/android"
  2.    xmlns:tools="http://schemas.android.com/tools"
  3.    android:layout_width="match_parent"
  4.    android:layout_height="match_parent"
  5.    android:id="@+id/map"
  6.    tools:context="xpak.xparking.MapsFragment"
  7.    class ="com.google.android.gms.maps.SupportMapFragment" />

mi parte del java file donde esta el error:

Código Java:
Ver original
  1. private void setUpMapIfNeeded() {
  2.         if (mMap == null) {
  3.             // Try to obtain the map from the SupportMapFragment.
  4.            mMap = ((SupportMapFragment) getFragmentManager().findFragmentById(R.id.map))
  5.                     .getMap();
  6.  
  7.             // Check if we were successful in obtaining the map.
  8.             if (mMap != null) {
  9.                 setUpMap();
  10.             }
  11.         }
  12.     }

error: incompatible types , cannot cast "android.app.fragment" to "com.google.android.gms.maps.supportmapfragmen t"

he buscado tanto que ya me se el error de memoria , estoy usando extends Fragment

Gracias por su ayuda en adelantado