I have been able to display Google Maps to display inside the fragment, but I cannot do anything else with it! I just have the main activity pointing to the MapFragment.java file which points to the map_fragment.xml file.
fragment_map.xml
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://ift.tt/nIICcg"
xmlns:map="http://ift.tt/GEGVYd"
android:name="com.google.android.gms.maps.MapFragment"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
map:cameraBearing="0"
map:cameraTargetLat="29.7189"
map:cameraTargetLng="-95.3392"
map:cameraTilt="0"
map:cameraZoom="13"
map:mapType="normal"
map:uiCompass="true"
map:uiRotateGestures="true"
map:uiScrollGestures="true"
map:uiTiltGestures="true"
map:uiZoomControls="true"
map:uiZoomGestures="true"/>
this is the MapFragment.java file
package info.teammumu.cougarcardapp;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class MapFragment extends Fragment {
public MapFragment(){}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_map, container, false);
return rootView;
}
}
Can anyone tell me where I am going wrong?
Aucun commentaire:
Enregistrer un commentaire