Acknowledged

Getting location information

RESOLVED:  Thanks Jim.  PEBKAC; I didn't realize that just starting the activity and having it show up on the map was not enough.  You need to wait for a GPS lock (green bar) and then start the activity. 

I've been banging my head on this for a while, hoping someone can help out.

I'm calling:

Activity.getActivityInfo().currentLocation; and it is ALWAYS returning null.  I understand that it will most of the time return null, but it is always returning null on my watch.

I have:

1.  Double checked to make sure that I have added: " <iq:uses-permission id="Positioning"/>" to my manifest.xml

2.  I have started a run activity as well as opened maps on my watch before calling for currentLocation

3.  I know it won't work on the simulator (always testing on my watch) unless doing Simulation>Activity Data>Data Simulation  (which does work).  Thanks Jim for the suggestion.

4.  Scrolled through and selected multiple watch faces (thanks Jim for the suggestion).

5.  I have uninstalled/reinstalled, rebooted --

done about everything other than throw my very nice watch out the window.  If anybody has any ideas, please send them my way.

Thanks!

Parents
  • Since you can try this in the sim, add a println to make sure your code is trying to get the currentLocation when it should.  This sounds like something in your code to me.

    When you do get a currentLocation that's not null, you want to save that in Application.Storage, so you have a location the next time currentLocation is null.

Comment
  • Since you can try this in the sim, add a println to make sure your code is trying to get the currentLocation when it should.  This sounds like something in your code to me.

    When you do get a currentLocation that's not null, you want to save that in Application.Storage, so you have a location the next time currentLocation is null.

Children