Obviously, Android apps sometimes don't know their location 
(lastKnownLocation returns null, etc.). Internally, we deal with this by 
checking if the app wide Location object is null and substituting -999 for 
latitude and longitude ... something that is obviously invalid so we can 
quickly spot it.

I'm wondering what other people do in this area. I looked at creating a Null 
Object Location <https://en.wikipedia.org/wiki/Null_Object_pattern> but got 
kinda worried by the two constructors for Locations that I might be barking 
up the wrong tree. Anyone have ideas on how to deal with creating a 
substitute location when the OS won't provide one?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to