0

i'm trying to create another relative layout but i'm getting error saying "the markup in the document following the root element must be well-formed" so i hope you can help me to make the another relativelayout working

this is my main.xml

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

<TextView 
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="اضغط على من تريد معرفة المزيد عنه"
android:padding="10dp"
/>

<Button
android:id="@+id/buttontype1"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Start" />

<Button
android:id="@+id/button1"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Start" />

<Button
android:id="@+id/button2"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Stop"/>

<Button
android:id="@+id/button3"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Start" />

<Button
android:id="@+id/button4"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="Stop" />

<Button
android:id="@+id/button5"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Start" />

<Button
android:id="@+id/button6"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Stop"/>

<Button
android:id="@+id/button7"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Start" />


<Button
android:id="@+id/button8"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Stop"/>

<Button
android:id="@+id/button9"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Stojjp"/>

</LinearLayout>


<LinearLayout 

<Button
android:id="@+id/button8"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="Stop"/>


<Button
android:id="@+id/button9"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="Stojjp"/>

</LinearLayout>
    </LinearLayout>

i hope u can help me & thanks

  • You should try this answer to the same question by another user: http://stackoverflow.com/a/17622752/3465623 – luiscosta Jul 28 '14 at 16:03

2 Answers2

1

You have the following line in the middle after android:text="Stojjp"/>:

</LinearLayout>

Remove it, as the inner LinearLayout should be inside the outer LinearLayout.

Also, your inner LinearLayout needs to have a closing >, as well as an android:layout_width and android:layout_height element in order to be valid.

BVB
  • 5,380
  • 8
  • 41
  • 62
0

Problem is your second linear Layout. It missing argument. This code :

<LinearLayout 

<Button
android:id="@+id/button8"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="Stop"/>


<Button
android:id="@+id/button9"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="Stojjp"/>

</LinearLayout>

Should be like that :

<LinearLayout 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" />

<Button
android:id="@+id/button8"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="Stop"/>


<Button
android:id="@+id/button9"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="Stojjp"/>

</LinearLayout>
Phil
  • 4,730
  • 1
  • 41
  • 39