0

In my app I need to capture the GPS location of the device. However, on certain devices this does not work when the Wi-Fi and mobile network location setting is on:

enter image description here

If I turn this setting off and reboot the device then the GPS reading works fine. In my manifest I have the following permission on:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

Note I have not turned Coarse Location on. I set up the location manager thus (it is written in Mono):

public void SetUpGPS()
    {
        Looper.Prepare();

        m_handler = new Handler();

        m_locationManager.RequestSingleUpdate(LocationManager.GpsProvider, this, null);

        Looper.Loop();
    }

where 'this' is a class that implements ILocationListener.

This works on all phones regardless of whether the above setting is on or off. However, on the two tablets I have tried it with you have to turn the above setting off or it will not return anything. The flashing gps icon does not appear in the notification bar. Any suggestions would be very much appreciated! Thanks, Dave

4

1 回答 1

0

我发现了问题。如果您使用 RequestLocationUpdates 而不是 RequestSingleUpdate 它适用于这种情况。

于 2013-10-15T08:44:20.357 回答