I’m trying to display the device’s position on a map. i got my app working but the map wouldn’t display. I’ve done lots of reading on the common errors for this eg map api key. my phone is a samsung galaxy 2.1. i noticed that i was building against google api8. so i mess up a bit on a few things and had to delete the project and copy and paste the src files back into a new project. the new project is built against google api7 now.
the problem is that the main.xml file has an error in it. The only thing i can think of is that i’ve changed what the project is built against api7 instead of api8. any ideas?
error: Error: String types not allowed (at 'layout_width' with value 'match_parent').
[edit] the error is in the relativelayout tag
.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content" android:gravity="fill">
<com.google.android.maps.MapView
android:id="@+id/myGMap"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="02wE28syQIHzpwXXa95CrtA1XJLU5segJgltvKQ"
/>
<EditText android:id="@+id/edittext1"
android:inputType="text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="CLOSE"
android:layout_alignParentRight="true"
android:id="@+id/close" ></Button>
</RelativeLayout>
Yes, in api level 7 there is no xml attibute match_parent exist, instead you need to use fill_parent.