2013-02-16 5 views
1

내 앱에 Google지도를 구현하고 있습니다.MapActivity 클래스를 확장 할 수 없습니까?

저는 API 키 등을 제공했으며 현재 튜토리얼 쿠페를 따르고 있습니다. MapActivity 수퍼 클래스를 확장해야하지만 현재 그렇게 할 수 없습니다.

내 XML 레이아웃에 API 키를 삽입하는 것과 함께 내 매니페스트에지도 라이브러리를 구현했습니다.

하지만 여전히 'MapActivity를 유형으로 확인할 수 없음'오류가 발생합니다.

<uses-sdk android:minSdkVersion="8" /> 

<uses-permission android:name="android.permission.INTERNET"/> 

<application 
    android:icon="@drawable/ic_launcher" 
    android:label="@string/app_name" > 
    <activity 
     android:name=".MainMap" 
     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> 
</manifest> 

<?xml version="1.0" encoding="utf-8"?> 

내 XML입니다 : Heres는 내 매니페스트입니다

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

<com.google.android.maps.MapView 
    android:id="@+id/mapView" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:enabled="true" 
    android:clickable="true" 
    android:apiKey="AIzaSyCJSfjl_7lU7-HKV3yIf5nnMODl6qiG2_g" 
    /> 

</RelativeLayout> 

그리고 내 클래스 :

package com.example.map; 

import android.os.Bundle; 
import android.app.Activity; 
import android.view.Menu; 

public class MainMap extends MapActivity { 

@Override 
protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.maplayout); 
} 

@Override 
public boolean onCreateOptionsMenu(Menu menu) { 
    // Inflate the menu; this adds items to the action bar if it is present. 
    getMenuInflater().inflate(R.menu.maplayout, menu); 
    return true; 
} 

} 

답변

0

그 빌드 대상 (확인 예 : 프로젝트> 속성> Andro id in Eclipse)는 Android SDK의 'Google APIs'버전 용입니다.

+0

으로 간단한 프로젝트 속성을 사용하여 Google API를이다. 유능한 때 당신의 대답을 정확하다고 표시합니다. – user1352057

0

이 시도 :

당신은 대상을 구축 프로젝트를 선택하는 것은 많은 감사 commonWare로

관련 문제