I am working with fragments and Google map... In order to code for the google map functionalities I need to extend mapactivity, however I am unable to do that as I have already extended fragment. Could someone please tell me a fix to this. I would really appreciate.
public class mapFragment extends Fragment
I need to get user's current location through something like this
rivate GoogleMap.OnMyLocationChangeListener myLocationChangeListener = new GoogleMap.OnMyLocationChangeListener() {
@Override
public void onMyLocationChange(Location location) {
LatLng loc = new LatLng(location.getLatitude(), location.getLongitude());
mMarker = mMap.addMarker(new MarkerOptions().position(loc));
if(mMap != null){
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(loc, 16.0f));
}
}
};
but for this I need to extend map activity.
Thanks.