Skip to content

Instantly share code, notes, and snippets.

@FilHazer

FilHazer/MapFragment.java Secret

Last active Jan 14, 2016
Embed
What would you like to do?
MapFragment
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
You can’t perform that action at this time.