[Solved] LocationManager.getProviders() returns empty list.

Put your problem here if it does not fit any of the other categories.

[Solved] LocationManager.getProviders() returns empty list.

Postby fwank » Wed Mar 05, 2008 4:29 am

Hello all,

I am using SDK m5 and attempting to access the list of Location Providers as follows:

...
mLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
List<LocationProvider> providers = mLocationManager.getProviders();

The returned list, "providers", is always empty. There should be at least one default mock provider, "gps". I verified that the mock "gps" provider is in data/misc/location. I have no idea why the getProviders() method is returning an empty list.

I read somewhere that including the following permission in my manifest file would solve the problem.

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

Including the above permission did not help...

Please help, thx!
-F
fwank
Freshman
Freshman
 
Posts: 2
Joined: Wed Mar 05, 2008 4:27 am

Top

Postby fwank » Wed Mar 05, 2008 5:45 am

After re-installing eclipse to the latest Java edition version and then re-installing the ADT plug-in the getProviders() method began to behave...
fwank
Freshman
Freshman
 
Posts: 2
Joined: Wed Mar 05, 2008 4:27 am

Postby res » Wed Mar 05, 2008 5:29 pm

ah what a pain, glad you got it working though :)
res
Senior Developer
Senior Developer
 
Posts: 146
Joined: Tue Nov 20, 2007 8:14 pm
Location: United States

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 18 guests