I was suffering the exact problem and finally found 'the' cause. In onCreate(Bundle arg0) I was calling super.onCreate(arg0) after the setContentView(R.layout.location_select_on_map_view) !
Once I corrected it the MapView was displayed correctly :-) E.g. @Override protected void onCreate(Bundle arg0) { super.onCreate(arg0); setContentView(R.layout.location_select_on_map_view); } Regards, Don On Jul 10, 12:16 pm, Victor Lin <borns...@gmail.com> wrote: > <?xml version="1.0" encoding="utf-8"?> > <manifest xmlns:android="http://schemas.android.com/apk/res/android" > package="com.ez2learn.android.powergrid" > android:versionName="1.0" android:versionCode="4"> > <application android:icon="@drawable/icon" android:label="@string/ > app_name" android:description="@string/app_description"> > <activity android:name=".PowerGrid" > 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"></uses- > library> > </application> > <uses-sdk android:minSdkVersion="3" /> > > <uses-permission android:name="android.permission.INTERNET"></uses- > permission> > </manifest> > > On 7月10日, 下午6時20分, Mark Murphy <mmur...@commonsware.com> wrote: > > > Victor Lin wrote: > > > Hi, > > > > I am building a application that use MapView. > > > > This is the map.xml file I create in layout folder: > > > > "<?xml version="1.0" encoding="utf-8"?> > > > <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/ > > > android" > > > android:id="@+id/MapLayout" > > > android:orientation="vertical" > > > 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:clickable="true" > > > android:apiKey="**************************" > > > /> > > > > </RelativeLayout>" > > > > And I set it as content view in onCreate: > > > > setContentView(R.layout.map); > > > > Then once I start up the program, I got a exception: > > > > android.view.InflateException: Binary XML file line #8: Error > > > inflating class java.lang.reflect.Constructor > > > > I do add "uses library" in manifest. It seems there is nothing wrong > > > in xml file. What am I doing wrong? How to fix it? > > > Could you post your manifest? > > > -- > > Mark Murphy (a Commons > > Guy)http://commonsware.com|http://twitter.com/commonsguy > > > Android Development Wiki:http://wiki.andmob.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---