Je continue d'obtenir une erreur sur la ligne pour le fragment de la carte de support, je suis nouveau à android et java alors, n'ont pas les réponses, il dit «; est attendu, mais une fois inséré avant le gestionnaire de fragments get enfant, il rend le fragment de carte de support inaccessible et j'obtiens une erreur sur toute la ligne.problème avec Google Maps et obtenir le gestionnaire de fragment enfant
ici est ma classe ici
package com.example.hp_user.shoutfinal28;
import android.app.FragmentManager;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
public class FragmentShouts_Maps extends Fragment implements OnMapReadyCallback {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Get the view from fragment shouts.xml
View view = inflater.inflate(R.layout.fragmentshouts_maps, container, false);
return view;
SupportMapFragment fragment = SupportMapFragment.newInstance(); getChildFragmentManager().findFragmentById(R.id.maps);
fragment.getMapAsync(this);
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
}
@Override
public void onMapReady (GoogleMap googleMap) {
}
}
est mon fichier xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<fragment android:id="@+id/maps"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.example.hp_user.shoutfinal28.FragmentShouts_Maps"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_alignParentEnd="true">
</fragment>
</RelativeLayout>
la première ligne indique une instruction inaccessible @Rehan –
@AlexanderRufus parce que vous avez mal placé la ligne de retour. J'ai mis à jour la réponse. Rafraîchir la pagge pour voir la réponse mise à jour – Rehan
Vous êtes un génie idk pourquoi mais j'ai complètement oublié ça et ça a été le problème tout ça lol @Rehan merci beaucoup –