【发布时间】:2016-04-06 15:12:39
【问题描述】:
当前位置指针正在跳转我转储以解决问题。我想停止跳转当前指针指针。我想显示指针而不跳转情况。 我尝试了 4 天,但没有完成此任务。
private boolean initMap() {
if (mMap == null && FirstTimeMapIniciate == 0) {
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
mMap = mapFragment.getMap();
mMap.setMyLocationEnabled(true);
mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
}
return (mMap != null);
}
这是 OnLocationChange 代码
@Override
public void onConnected(Bundle bundle) {
Toast.makeText(this, "Ready to map!", Toast.LENGTH_SHORT).show();
mListener = new LocationListener() {
@Override
public void onLocationChanged(Location location) {
latitude = location.getLatitude();
longitude = location.getLongitude();
LatLng latLng1 = new LatLng(latitude, longitude);
MarkerOptions mp = new MarkerOptions();
mp = new MarkerOptions();
mp.position(new LatLng(location.getLatitude(),
location.getLongitude()));
mMap.setMyLocationEnabled(true);
// mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
Toast.makeText(MainActivity.this, "Location : " + location.getLatitude() + ", " + location.getLongitude(), Toast.LENGTH_LONG).show();
if (FirstTimeMapIniciate == 0) {
gotoLocation(location.getLatitude(), location.getLongitude(), 15);
FirstTimeMapIniciate = 1;
}
AppUtill.UniqueId();
new JSONAsyncTask().execute("http://103.8.7/hajjapi/api/GPSLocator/GetLocations");
if (AppStatus.getInstance(getContext()).isOnline()) {
} else {
Toast.makeText(MainActivity.this, "Turn On your WIFI ", Toast.LENGTH_LONG).show();
}
/* if (marker != null) {
marker.remove();
}*/
}
};
LocationRequest request = LocationRequest.create();
request.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
request.setInterval(1000);
request.setFastestInterval(1000);
LocationServices.FusedLocationApi.requestLocationUpdates(mLocationClient, request, mListener);
}
【问题讨论】:
-
请任何人帮助我...
-
请帮帮我.......
标签: android performance shell android-layout android-fragments