2010-11-10 67 views
-1

這裏的分辨率是我在我的map.xml文件:什麼是確切的原因和「錯誤充氣類com.google.android.maps.MapView」

<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="0p8EoZESYekrClENQbOlN5EN16DgXv7Rx0CPTMg"    
      /> 

清單文件:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
     package="com.apps.locid" 
     android:versionCode="1" 
     android:versionName="1.0"> 
    <application android:icon="@drawable/icon" android:label="@string/app_name"> 
     <activity android:name=".LocID" 
        android:label="@string/app_name"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
     <activity android:name=".Map" 
        android:label="@string/app_name"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
     <activity android:name=".web_view" 
        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-sdk android:minSdkVersion="8" /> 

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



</manifest> 
+0

檢查該解決方案http://stackoverflow.com/a/7644635/779408 – breceivemail 2012-10-27 07:38:45

回答

2

沒有更多的在你的日誌(使用logcat)或在堆棧跟蹤?

+0

這就是我得到我的logcat:11-10 15:05:15.853:ERROR/AndroidRuntime(1528): java.lang.RuntimeException:無法啓動活動ComponentInfo {com.apps.locid/com.apps.locid.Map}:android.view.InflateException:二進制XML文件行#10:錯誤擴展類com.google.android.maps .map – 2010-11-10 10:06:37

+1

問題已解決。忘了將我的課程擴展到MapActivity。 :D謝謝 – 2010-11-10 10:20:16

+0

我也忘了..:D – 2012-10-16 10:43:50

2

您是否將主類擴展爲MapActivity?

public class a 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; 
    } 
}