0
我是android開發的初學者,我正在試圖通過gps獲取用戶位置。我給下面的代碼一個錯誤:在這一行獲取用戶位置錯誤
// Define a listener that responds to location updates
LocationListener locationListener = new LocationListener() {
public void onLocationChanged(Location location) {
// Called when a new location is found by the network location provider.
// makeUseOfNewLocation(location);
LocationProvider locationProvider = LocationManager.GPS_PROVIDER;
}
LocationProvider locationProvider = LocationManager.GPS_PROVIDER;
我得到這樣的錯誤:「類型不匹配:不能從字符串轉換爲LocationProvider」
是什麼在該行的問題