-
-
Save FilHazer/ebc13a5e9601ff369999 to your computer and use it in GitHub Desktop.
MapFragment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MapFragment extends Fragment { | |
MapView mapView; | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
View rootView = inflater.inflate(R.layout.map, container, false); | |
//initialize map | |
mapView = (MapView) rootView.findViewById(R.id.mapView); | |
mapView.onCreate(savedInstanceState); | |
mapView.getMapAsync(new OnMapReadyCallback() { | |
@Override | |
public void onMapReady(GoogleMap googleMap) { | |
Log.i("DEBUG", "onMapReady"); | |
} | |
}); | |
return rootView; | |
} | |
@Override | |
public void onResume() { | |
mapView.onResume(); | |
super.onResume(); | |
} | |
@Override | |
public void onDestroy() { | |
super.onDestroy(); | |
mapView.onDestroy(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment