2012-09-06 2 views
0

현재 Google지도가 포함 된 응용 프로그램을 만들고 있습니다. 해당 XML 파일의 코드는 아래에 나와 있지만 그래픽 레이아웃에서는 오류가 표시됩니다.Google MapView에 오류가 있습니다.

"누락 된 스타일이 레이아웃에 올바른 테마가 선택되어 있습니까? 레이아웃 위의 테마 콤보 상자를 사용하여 다른 레이아웃을 선택하거나, 또는 테마 스타일의 참조를 해결

는 현재 테마 "

GoogleMap으로 실행이

java.lang.RuntimeException가 같은 로그 캣에서 오류가 표시에서 스타일 'mapViewStyle'를 찾는 데 실패

:. 없음 활동을 시작합니다 ComponentInfo {com.iqmobi/com.iqmobi.Map} : android.view.InflateExc eption : 바이너리 XML 파일 라인 # 3 : 오류 팽창 클래스 com.google.android.maps.MapView

는 XML 및 매니페스트 파일은

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



    <com.google.android.maps.MapView 
    android:id="@+id/myMapView1" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:clickable="true" 
    android:apiKey="0mRN-6bSm63hZJtPZSmcjoZAzdCztLnZv-O4SZw" 
    > 
    </com.google.android.maps.MapView> 





    </LinearLayout> 

manifest.xml

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


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

<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" /> 
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 


<application 
    android:icon="@drawable/iconffff" 
    android:label="@string/app_name" > 
    <uses-library android:name="com.google.android.maps" /> 
    <activity 
     android:label="@string/app_name" 
     android:name="com.iqmobi.Map" 
     android:screenOrientation="portrait" 
     > 
     <intent-filter > 
      <action android:name="android.intent.action.MAIN" /> 

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

아래에서 언급

+0

프로젝트를 청소하고 실행 해보십시오. 이것을 사용하지 않는다면 작업 공간을 재시작하고 사용해보십시오. – Praveenkumar

+0

활동 대신지도 활동을 확장 했습니까? –

+0

https://developers.google.com/maps/documentation/android/hello-mapview – Ishtiaq

답변

0

당신은

public class Abc extends MapActivity { 
    /** Called when the activity is first created. */ 
    @Override 
    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.main); 
    } 

    @Override 
    protected boolean isRouteDisplayed() { 
     // TODO Auto-generated method stub 
     return false; 
    } 
} 
MapActivity로 메인 클래스를 확장 할 필요가
0
는 RelativeLayout의에 레이아웃을 변경하고 </com.google.android.maps.MapView>
는 다음과 같이 넣어이 줄을 제거, 레이아웃 ID를하지 않고, 다음과 같이

:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 

    <com.google.android.maps.MapView 
      android:id="@+id/myMapView1" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:enabled="true" 
       android:clickable="true" 
       android:apiKey="api key" /> 

</RelativeLayout> 
관련 문제