I have an unpleasant problem. I use Fragment in my Android project, and it causes me endless pain, because I have to clean up the project every time when I edit the main xml file. Here's what it looks like:
<?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">
<fragment xmlns:map="http://schemas.android.com/apk/res-auto"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
class="com.google.android.gms.maps.MapFragment"
map:uiRotateGestures="false"
map:uiScrollGestures="false"
map:uiZoomControls="false"
map:uiZoomGestures="false"
map:cameraZoom="18"
/>
<ScrollView
android:id="@+id/scroller"
android:layout_width="250dp"
android:layout_height="100dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:background="@android:color/white">
<TextView
android:id="@+id/debug_text"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textSize="10sp"
/>
</ScrollView>
</RelativeLayout>
And if I edit even one character of this file, all lines starting with "map" will be highlighted in red, and the tag for opening the fragment will also be highlighted. The error I get is:
Unexpected namespace prefix "xmlns" found for tag fragment
And for lines starting with "map", the error is:
Unexpected namespace prefix "map" found for tag fragment
If I clean the project, the problem disappears, and I can create and run the project just fine, but since I am editing it a lot now, it is very very annoying. Can anyone help?
source