use of im.delight.android.location.SimpleLocation in project BloodHub by kazijehangir.
the class RequestMapFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_request_map, container, false);
mMapView = (MapView) rootView.findViewById(R.id.mapView);
mMapView.onCreate(savedInstanceState);
location = new SimpleLocation(getContext());
// needed to get the map to display immediately`
mMapView.onResume();
// For showing a move to my location button googleMap.setMyLocationEnabled(true);
if (ContextCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
setupMap();
} else {
// Show rationale and request permission.
if (permissionRequestCount < REQUEST_LIMIT) {
permissionRequestCount++;
ActivityCompat.requestPermissions(getActivity(), new String[] { Manifest.permission.ACCESS_FINE_LOCATION }, MY_PERMISSIONS_REQUEST_FINE_LOCATION);
}
}
return rootView;
}
Aggregations