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?

Do you have both

        <uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-
permission>
        <uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION"></uses-
permission>

in your manifest?  When you started your app did you answer the
dialog saying it's ok to use gps?  Is the

settings->location&security->Use GPS satellites

checkbox checked on the phone?  If all those are true/positive, we
might
need to see more code.

-- 
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