Question

Is there any option to start/stop compass after compass sensor was requested.

I would to stop receiving events from compass to save battery but found no such an option (no dispose, no close, no stop as we have for windows phone)

Thanks!

Était-ce utile?

La solution

if you are using C# you can unsubscribe for the event to stop receiving notifications from the compass. I dont think it is possible to turn off the compass altogether as other applications may be using it

Subscribe:

       _compass.ReadingChanged += new TypedEventHandler<Compass, CompassReadingChangedEventArgs>(ReadingChanged);

UnSubscribe:

       _compass.ReadingChanged -= ReadingChanged;
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top