我想在模拟器上完全测试我的 LocationListener(),看看它是否在所有情况下都能正常工作。有没有办法使用模拟器测试 onProviderDisabled() 和 onProviderEnabled() ?
location_listener = new LocationListener(){
public void onLocationChanged(Location location) {
// Update application based on new location
updateLocation(location);
}
public void onProviderDisabled(String provider) {
// Update application if provider disabled
setContentView(R.layout.lostgps);
}
public void onProviderEnabled(String provider) {
// Update application if provider enabled
setContentView(R.layout.game);
}
public void onStatusChanged(String provider, int status,
Bundle extras) {
// Update application if provider hardware status changed
}
};