Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Geocoder.isPresent() undefined for the type Geocoder

My Android and Java skills aren't so hot...

In the developer.android.com page for Geocoder, it says :

The Geocoder query methods will return an empty list if there no backend service in the platform. Use the isPresent() method to determine whether a Geocoder implementation exists.

However, when I try to call, for example :

if (Geocoder.isPresent()) {...

Eclipse tells me

The method isPresent() is undefined for the type Geocoder

How can I "use the isPresent() method"?

like image 260
Max Waterman Avatar asked May 03 '26 11:05

Max Waterman


1 Answers

public static boolean isPresent () method only available from API level 9, It means you should use Android 2.3 or latter version for that. Make sure you are using that. Then check Eclipse project configuration for Android SDK.

Reference: http://developer.android.com/reference/android/location/Geocoder.html

like image 131
Senthil Avatar answered May 05 '26 00:05

Senthil



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!