views:

218

answers:

1

Hello, I have been trying to get the following code to work for the last 4 hours.

public void clearLocation() { 
    LocationManager locMan =
            (LocationManager)getSystemService(Context.LOCATION_SERVICE); 
    locMan.clearTestProviderLocation("gps"); 

My problem is that it will only work with Android 1.5. On 1.6 and newer it just crashes when it reaches the second statement.

I've been looking through various code snippets and tutorials, but haven't been able to find anything about this.

Regards, Adam.

+1  A: 

Well... found out that you can't change anything about the location provider "gps" in 1.6+

Adam Honoré
Considering that doing so would be a security violation -- allowing you to forge being GPS -- I'm not terribly surprised.
CommonsWare