But the thing is location can't be null. If it was the app wouldn't have reached here. I check for location being null in my main activity:
if (location != null) { // Update my location marker positionOverlay.setLocation(location); Only the does MyPositionOverlay receive location. On Thu, Jul 7, 2011 at 11:23 PM, TreKing <treking...@gmail.com> wrote: > On Thu, Jul 7, 2011 at 12:45 PM, Raghav Sood <raghavs...@gmail.com> wrote: > >> Double latitude = location.getLatitude()*1E6; >> >> >> It is a NullPointerException so I suppose it is returning null. >> > > NullPointerExceptions are cause by *objects* that are set to null. The only > *object* in that statement is "location". Thus, that's what is null. > > You can verify this by using your debugger and breaking at that line. > > I'd recommend you brush up on Java and the different between Object types > and Value types to understand the differences between the two. > > > ------------------------------------------------------------------------------------------------- > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago > transit tracking app for Android-powered devices > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Raghav Sood http://www.raghavsood.com/ http://wiki.androidappcheck.com/ http://www.telstop.tel/ https://market.android.com/developer?pub=Raghav+Sood -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en