Obviously "LastKnownLocation" can return not null only if someone turns GPS on and gets a position fix. You need to create a listener for this particular location provider and stop it after the first position is reported (not after the first one).
Of course it would be better to see "getBestKnownLocation()" in the LocationManager but I guess Google found the definition of "best" is too fuzzy ;) On Nov 23, 2:28 am, Leon Li <[email protected]> wrote: > hi all: > i use Location location=manager.getLastKnownLocation("gps") to get > real gps,but it allways return null,and i walk around outside office > long time. > but if i use "network",it work. > > dose anyone else know what is wrong? -- 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

