Update :
I found the solution,but still getting error. Use 2 location variable to
get the previous position before changed :

public void onLocationChanged(Location newLocation) {
prevLocation = currentPosition;
currentPosition = new Location (newLocation);
int lat1 = (int) (currentPosition.getLatitude()*1E6);
int longi1 = (int) (currentPosition.getLongitude()*1E6);
geoPoint = new GeoPoint (lat1, longi1);
showPosition();
mapView.getController().animateTo(geoPoint);
mapView.invalidate();
//Toast.makeText(getBaseContext(), "position =" + currentPosition,
Toast.LENGTH_LONG).show();
//mapView.postInvalidate();
     //showPosition();
bearing = prevLocation.bearingTo(currentPosition);
                   }
};
          }

But when i running the program, it's take long to get the coordinates, and
get force close at the end.
Can somebody help me?

On Wed, Mar 7, 2012 at 11:43 AM, concave <agung.wiguna.jo...@gmail.com>wrote:

> Hi all, need help in here
> I developed Map android, and one of the feature is the map can rotate.
> I already tried to rotate map with sensor, and it's success. But now ,
> i need to developed map that can rotate without any sensor.
> So, i need to get an angle from 2 coordinates (first before the
> location changed/ or user change direction, second after location
> changed / user change direction)
> But i don't have any idea how to get coordinates before the location
> changed (before the value latitude and longitude updated).
> Can somebody help me to solved this ?
> Thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to