Get last location latitude and longitude
<p>This is my code.</p>

<pre><code>public class MyLocationListener implements LocationListener {

    @Override
    public void onLocationChanged(Location loc) {

        Location location = mlocManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
              LastLocationLat = location.getLatitude();
        LastLocationLongi = location.getLongitude();

        LocationLat = loc.getLatitude();
        LocationLongi = loc.getLongitude();

        if(loc.hasSpeed())
        {
            float mySpeed = loc.getSpeed();
            Toast.makeText(getApplicationContext(), ""+mySpeed, 2000).show();

        }
    }

    @Override
    public void onProviderDisabled(String provider)
    {

        Toast.makeText(getApplicationContext(), "Gps Disabled",
                Toast.LENGTH_SHORT).show();

    }

    @Override
    public void onProviderEnabled(String provider)
    {

        Toast.makeText(getApplicationContext(), "Gps Enabled",
                Toast.LENGTH_SHORT).show();

    }

    @Override
    public void onStatusChanged(String provider, int status, Bundle extras)
    {
        Toast.makeText(getApplicationContext(), "Gps onStatusChanged",
                Toast.LENGTH_SHORT).show();
    }

}
</code></pre>

<p>But i did not get  last location in this code i got same latitude and longitude </p>
