android中的MapView是完全黑色的

android中的MapView是完全黑色的,android,Android,我正在应用程序中使用mapView。在我的模拟器上,我得到的是黑屏,而不是这张地图。我已经添加了权限并添加了标记。当我在模拟器上运行我的应用程序时,它会显示黑屏而不是地图 public class MainActivity extends MapActivity { MapView mv; MapController mc; GeoPoint mPoint; @Override protected void onCreate(Bundle savedI

我正在应用程序中使用mapView。在我的模拟器上,我得到的是黑屏,而不是这张地图。我已经添加了权限并添加了
标记。当我在模拟器上运行我的应用程序时,它会显示黑屏而不是地图

public class MainActivity extends MapActivity {

    MapView mv;
    MapController mc;
    GeoPoint mPoint;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mv = (MapView) findViewById(R.id.map);
        mv.setBuiltInZoomControls(true);
        mv.setSatellite(true);
        mc = mv.getController();
        mPoint = new GeoPoint(70, 30);
        mc.animateTo(mPoint);
        Bitmap bitmap = BitmapFactory.decodeResource(getResources(), android.R.drawable.sym_action_email);
        MarkerOverlay mo = new MarkerOverlay(bitmap);
        mv.getOverlays().add(mo);
    }

    @Override
    protected boolean isRouteDisplayed() {
        return false;
    }
    class MarkerOverlay extends Overlay{
        Bitmap marker;
        public MarkerOverlay(Bitmap bitmap) {
            this.marker = bitmap;
        }
        @Override
        public void draw(Canvas canvas, MapView mapView, boolean shadow) {
            super.draw(canvas, mapView, shadow);
            Point p = new Point();
            mapView.getProjection().toPixels(mPoint, p);
            canvas.drawBitmap(marker, p.x, p.y,null);
        }
    }


}
layout.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <com.google.android.maps.MapView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/map"
        android:apiKey="0N2w90XW-PeM2vP4D4yfM2CoLRfIF6nnZAr2Cqg" />

</LinearLayout>

manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.overlays"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="5"
        android:targetSdkVersion="10" />
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <uses-library android:name="com.google.android.maps"/>
        <activity
            android:name="com.example.overlays.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

好的。我觉得我的项目出了点问题。我删除了我目前的项目,并建立了一个新的,它工作得很好

mc.setZoom(17);
设置您的缩放级别,它们将获得默认的缩放级别1。请参阅文章


你从谷歌控制台获得地图API密钥了吗?
你能发布你的XMl和清单文件吗???@subburaj-okey。我已经编辑了我的帖子。您可以看到我的manifest and layout.xmlRU使用什么模拟器…RU使用Google API模拟器??我认为这不是问题所在。