Android 删除模拟位置提供程序问题

Android 删除模拟位置提供程序问题,android,gps,Android,Gps,我正在我的应用程序中使用测试GPS提供商,当我尝试在使用后清理测试提供商时 问题是我的GPS在那之后停止工作,我做错了什么 这是我的密码: if (locationManager.getProvider(LocationManager.GPS_PROVIDER)!=null){ locationManager.setTestProviderEnabled(LocationManager.GPS_PROVIDER, false); locationManager.removeTes

我正在我的应用程序中使用测试GPS提供商,当我尝试在使用后清理测试提供商时

问题是我的GPS在那之后停止工作,我做错了什么

这是我的密码:

if (locationManager.getProvider(LocationManager.GPS_PROVIDER)!=null){
    locationManager.setTestProviderEnabled(LocationManager.GPS_PROVIDER, false);
    locationManager.removeTestProvider(LocationManager.GPS_PROVIDER);
}
我知道有一个,但我更喜欢用旧的