2 ssummeraw ssummeraw 于 2013.04.17 09:49 提问

在 launch 中的 Mapview 事例

我在做一个 mapview 事例,但是它在 activity launch 上崩溃。我创建的目标是在version 2.1上Google API ,在模拟器和真机上都崩溃,也不能重写isRouteDisplayed 方法,贴出代码:

package com.sandy.hellogooglemaps;
import android.app.Activity;
import android.os.Bundle;
import com.google.android.maps.MapView;
public class HelloGoogleMaps extends Activity {
     /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);        
        MapView mapView = (MapView) findViewById(R.id.mapview);
        mapView.setBuiltInZoomControls(true);
    }    
    //@Override
    protected boolean isRouteDisplayed() {
        return false;
    }
}

manifest file:

<application android:icon="@drawable/icon" 
android:theme="@android:style/Theme.NoTitleBar"
android:label="@string/app_name">
    <activity android:name=".HelloGoogleMaps"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <uses-library android:name="com.google.android.maps" />
</application>
<uses-permission android:name="android.permission.INTERNET" />

请求帮助!

Csdn user default icon
上传中...
上传图片
插入图片