我想在模拟器上完全测试我的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
}
};
答案 0 :(得分:1)