I want to show google maps in an android app. show that I am doing the basic step as follows:
AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
maps.xml
<view android:id="@+id/mv" class="com.google.android.maps.MapView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:clickable="true" android:apiKey="0cNoErXkpZDlKvCYr_OFj5xZD39-***********" />
and this can display the class method, import and onCreate
import com.google.android.maps.GeoPoint; import com.google.android.maps.MapActivity; import com.google.android.maps.MapController; import com.google.android.maps.MapView; import android.os.Bundle;
onCreate () method for map classes
public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.maps); mapView = (MapView)findViewById(R.id.mv); mapView.setSatellite(false); mapView.setTraffic(false); mapView.setBuiltInZoomControls(true); int maxZoom = mapView.getMaxZoomLevel(); int initZoom = maxZoom-2; mapControl = mapView.getController(); mapControl.setZoom(initZoom); latE6 = (int) (lat*1e6); lonE6 = (int) (lon*1e6); gp = new GeoPoint(latE6, lonE6); mapControl.animateTo(gp); overlayButton = (Button)findViewById(R.id.doOverlay);
but why didnβt my card show, I only see a grid without maps, and when I try to read logcat, I see this error with yellow color
Recycling dispatcher android_maps_conflict_a voidance.com.google.googlenav.datarequest.DataRequestDispatcher@ 40563470
Please help me. thanks mate
source share