0

There's something wrong with my xml file. I know it's something connected with namespaces. I wrote this TOPIC and tried to do some magic, but that still doesn't work. As You see I marked Linear Layout with x,a,b,c,d,e

Here's my XML:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <ScrollView
        android:id="@+id/scrollView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" >

            <LinearLayout

                android:id="@+id/llDetailsRowLayout"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_marginLeft="5dp"
                android:layout_marginRight="5dp"
                android:layout_marginTop="5dp"
                android:orientation="vertical" >

                <RelativeLayout
                    android:id="@+id/rlTaskTitle"
                    android:layout_width="match_parent"
                    android:layout_height="40dp"
                    android:layout_marginLeft="4dp"
                    android:layout_marginRight="4dp"
                    android:background="@drawable/bar_task_checklist_blue"
                    android:paddingBottom="5dp" >

                    <TextView
                        android:id="@+id/tvTitle"
                        android:layout_width="200dp"
                        android:layout_height="25dp"
                        android:paddingLeft="10dp"
                        android:paddingTop="5dp"
                        android:text="@string/task_title"
                        android:textColor="@color/my_white"
                        android:textSize="16sp"
                        android:textStyle="bold" />

                    <TextView
                        android:id="@+id/text_seperator"
                        android:layout_width="wrap_content"
                        android:layout_height="25dp"
                        android:layout_alignParentTop="true"
                        android:layout_toRightOf="@+id/tvTitle"
                        android:paddingRight="10dp"
                        android:paddingTop="5dp"
                        android:text="@string/seperator"
                        android:textColor="@color/my_white"
                        android:textSize="16sp"
                        android:textStyle="bold" />

                    <TextView
                        android:id="@+id/text_id"
                        android:layout_width="wrap_content"
                        android:layout_height="25dp"
                        android:layout_alignBaseline="@+id/tvTitle"
                        android:layout_alignBottom="@+id/tvTitle"
                        android:layout_toRightOf="@+id/text_seperator"
                        android:gravity="center_vertical"
                        android:paddingTop="5dp"
                        android:text="@string/id_string"
                        android:textColor="@color/my_white"
                        android:textSize="16sp"
                        android:textStyle="bold" />

                    <ImageView
                        android:id="@+id/iTaskStatusButton"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentRight="true"
                        android:layout_alignParentTop="true"
                        android:contentDescription="@drawable/task_sort_icon_selector"
                        android:paddingBottom="8dp"
                        android:paddingLeft="10dp"
                        android:paddingRight="10dp"
                        android:paddingTop="5dp"
                        android:src="@drawable/task_sort_icon_selector" />
                </RelativeLayout>
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="1dp"
                android:layout_marginRight="1dp"
                android:background="@drawable/test6"
                android:orientation="vertical" >

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal" >

                    <ImageView
                        android:id="@+id/iCalendar"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:contentDescription="@drawable/calendar_blue"
                        android:paddingLeft="10dp"
                        android:src="@drawable/calendar_blue" />

                    <TextView
                        android:id="@+id/tvDate"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:paddingLeft="5dp"
                        android:text="@string/date_string"
                        android:textAppearance="?android:attr/textAppearanceLarge"
                        android:textColor="@color/my_darker_gray"
                        android:textSize="11sp" />

                    <ImageView
                        android:id="@+id/iClock"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:contentDescription="@drawable/clock_blue"
                        android:paddingLeft="5dp"
                        android:src="@drawable/clock_blue" />

                    <TextView
                        android:id="@+id/tvTime"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:paddingLeft="5dp"
                        android:text="@string/time_string"
                        android:textAppearance="?android:attr/textAppearanceLarge"
                        android:textColor="@color/my_darker_gray"
                        android:textSize="11sp" />

                    <ImageView
                        android:id="@+id/iLocation"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:contentDescription="@drawable/pinplace_blue"
                        android:paddingLeft="5dp"
                        android:src="@drawable/pinplace_blue" />

                    <TextView
                        android:id="@+id/tvCity"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:paddingLeft="5dp"
                        android:text="@string/address_string"
                        android:textAppearance="?android:attr/textAppearanceLarge"
                        android:textColor="@color/my_darker_gray"
                        android:textSize="11sp" />
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/llDescription"
                    android:layout_width="match_parent"
                    android:layout_height="50dp" >

                    <TextView
                        android:id="@+id/tvDescription"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:clickable="true"
                        android:onClick="onDescriptionClick"
                        android:paddingLeft="10dp"
                        android:paddingRight="10dp"
                        android:paddingTop="5dp"
                        android:text="@string/task_description"
                        android:textColor="@color/my_black"
                        android:textSize="12sp" />
                </LinearLayout>
            </LinearLayout>

            <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dp"
                android:layout_marginRight="5dp"
                android:layout_marginTop="5dp"
                android:background="@drawable/map_box" >

                <fragment
                    xmlns:map="http://schemas.android.com/apk/res-auto"
                    android:id="@+id/map"
                    android:name="com.google.android.gms.maps.SupportMapFragment"
                    android:layout_width="match_parent"
                    android:layout_height="170dp"
                    android:layout_marginLeft="5dp"
                    android:layout_marginRight="5dp"
                    android:layout_marginTop="4dp"
                    map:mapType="normal"
                    map:uiCompass="true"
                    map:uiRotateGestures="true"
                    map:uiScrollGestures="true"
                    map:uiTiltGestures="true"
                    map:uiZoomGestures="true" />
            </FrameLayout>
        </LinearLayout>
    </ScrollView>

</LinearLayout>

Still got problem at map:

enter image description here

Community
  • 1
  • 1
krzakov
  • 3,871
  • 11
  • 37
  • 52
  • I really don't know about this `` what is this prefex `x`, is it valid? – Pragnani May 12 '13 at 16:26
  • @Pragnani: Prefix is just an alias and can be named anything syntactically valid. By convention, `android` is a prefix for `http://schemas.android.com/apk/res/android` but it could as well be `windowsphone`. However, the problem here is that `x` etc. are not declared. – laalto May 12 '13 at 16:42

1 Answers1

0

Remove the namespace prefixes x, a, b, c, d and e that are not declared.

Generally, namespace prefix x would be declared as xmlns:x="http://some.schema.somewhere" attribute in an element where the prefix is used. However, you don't need to use namespaces for Android XML tags. You do need namespaces for attributes though, and in your XML there are two namespaces for those: android and map.

There's also a duplicate android namespace declaration as noticed by @Pragnani.

laalto
  • 150,114
  • 66
  • 286
  • 303