Help with a program (to use the LocationSensor Provider option)

You have some problems. If you do not set ProviderLocked to true, the LocationSensor will automatically change the provider if necessary to determine a location. If a gps receiver is not available, the app will use passive or network automatically. I think you are over engineering this and I suspect there is no need to code like this:


But if you insist on trying, the indicated changes might fix your issue. None of your = options will fire unless your coordinates are the default 0,0 . perhaps that is what you want to happen? If you want a different result; you might put the if statements in separate Button.click event handlers and do not set ProviderLocked to true. If ProviderLocked is set to true, it is impossible to select a different provider.

If you have not already read * Using the Location Sensor, read it now. It explains how Provider is used. If you read it already, consider re-reading.