Possible Duplicate:
Couldn’t get connection factory client
I try to use Android MapActivity so I created my API Key from my Debug.keystore MD5 via this link https://developers.google.com/android/maps-api-signup
Then I set this line of code in my Manifest:
Child of Application
<uses-library android:name="com.google.android.maps" />
set my permission like this
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_GPS" />
<uses-permission android:name="android.permission.ACCESS_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" />
and set MapView like this with my api key
<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:apiKey="MY API KEY"
android:clickable="true" />
In the Java file, MapActivity, I did my code from example like this:
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
// Define the criteria how to select the locatioin provider -> use
// default
Criteria criteria = new Criteria();
provider = locationManager.getBestProvider(criteria, false);
Location location = locationManager.getLastKnownLocation(provider);
if (location != null) {
System.out.println("Provider " + provider + " has been selected.");
onLocationChanged(location);}
My code used to work fine. I could set my pin point via overlayItem but after I came back to view my code again with doing nothing with my MapActivity,it doesn't work anymore. My LogCat show me like MapActivity "Couldn't get connection factory client"
I get to /.android Folder and deleted my debug.keystore and gen my new API Key again from it but It still doesn't work.
Does anyone know how to fix this problem?
Edit: More information, the location always be null.