Psycop Posted May 3, 2015 at 02:19 PM Report Share #582364 Posted May 3, 2015 at 02:19 PM (edited) Boa tarde Estou a tentar incluir a api Maps dentro de um fragmento com o objectivo de representar a localização de um edifício, no entanto todas as tentativas tem resultado no crash do respectivo fragmento (view) quando esta é chamada. O código xml é o seguinte: <fragment android:id="@+id/map" class="com.google.android.gms.maps.SupportMapFragment" android:layout_width="300dp" android:layout_height="300dp" android:layout_centerHorizontal="true" android:layout_below="@+id/textView_5" android:layout_marginTop="25dp" /> No java do fragmento tenho o seguinte: View rootview; //Variavel das Coordenadas static final LatLng CERTIC = new LatLng(41.287138, -7.740733); private GoogleMap map; @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootview = inflater.inflate(R.layout.menu_contactos_layout, container, false); //Mapa map = ((SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map)).getMap(); //Marker posição CERTIC no Mapa Marker certic = map.addMarker(new MarkerOptions().position(CERTIC).title("CERTIC")); Tenho a key correctamente gerada, e a API Google Play Services está instalada no Android Studio. Não consigo perceber o porque, se alguém me conseguir ajudar agradecia. Edited May 3, 2015 at 02:25 PM by Psycop Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now