0

I am beginner in Android Application. Hi! There is a compile-time error when I am coding the XML file. Can anyone help me what is wrong? The most outer Linearlayout keep complaining.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout                 **// This LinearLayout keep complaining**
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:weightSum="10"
    android:orienation="vertical">

    <!-- Radio Group on the top -->
    <RadioGroup
        android:id="@+id/rg"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:weightSum="3"
        android:background="#3BE5FF">

        <RadioButton
            android:id="@+id/rbt3"
            android:layout_weight="1"
            android:layout_width="0dp"
            android:layout_height="fill_parent"
            android:layout_marginRight="0.5dp"
            android:layout_marginBottom="0.5dp"
            android:background="#ffffff"
            android:gravity="center"
            android:checked="true" />

        <RadioButton
            android:id="@+id/rbt2"
            android:layout_weight="1"
            android:layout_width="0dp"
            android:layout_height="fill_parent"
            android:layout_marginRight="0.5dp"
            android:layout_marginBottom="0.5dp"
            android:background="#ffffff"
            android:gravity="center"/>

        <RadioButton
            android:id="@+id/rbt1"
            android:layout_weight="1"
            android:layout_width="0dp"
            android:layout_height="fill_parent"
            android:layout_marginBottom="0.5dp"
            android:background="#ffffff"
            android:gravity="center"/>
    </RadioGroup>

    <!-- Input Window -->
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:weightSum="3"
        android:background="#3BE5FF">

    </LinearLayout>

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:weightSum="3"
        android:background="#3BE5FF">

    </LinearLayout>

</LinearLayout>

Can anyone tell me what is wrong?

  • Hi, I see you're new to SO. If you feel an answer solved the problem, please mark it as 'accepted' by clicking the green check mark. This helps keep the focus on older SO which still don't have answers. – kkaosninja Mar 14 '15 at 14:51

2 Answers2

1

you mispelled orientation.

Change

android:orienation

to

android:orientation
Blackbelt
  • 156,034
  • 29
  • 297
  • 305
1

Change your layout file to the one mentioned below

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"       
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:weightSum="10"
android:orientation="vertical">

<!-- Radio Group on the top -->
<RadioGroup
    android:id="@+id/rg"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:weightSum="3"
    android:background="#3BE5FF">

    <RadioButton
        android:id="@+id/rbt3"
        android:layout_weight="1"
        android:layout_width="0dp"
        android:layout_height="fill_parent"
        android:layout_marginRight="0.5dp"
        android:layout_marginBottom="0.5dp"
        android:background="#ffffff"
        android:gravity="center"
        android:checked="true" />

    <RadioButton
        android:id="@+id/rbt2"
        android:layout_weight="1"
        android:layout_width="0dp"
        android:layout_height="fill_parent"
        android:layout_marginRight="0.5dp"
        android:layout_marginBottom="0.5dp"
        android:background="#ffffff"
        android:gravity="center"/>

    <RadioButton
        android:id="@+id/rbt1"
        android:layout_weight="1"
        android:layout_width="0dp"
        android:layout_height="fill_parent"
        android:layout_marginBottom="0.5dp"
        android:background="#ffffff"
        android:gravity="center"/>
</RadioGroup>

<!-- Input Window -->
<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:weightSum="3"
    android:background="#3BE5FF">

</LinearLayout>

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:weightSum="3"
    android:background="#3BE5FF">

</LinearLayout>

As @Blackbelt mentioned, orientation is misspelled.

Also, you missed the xmlns:android attribute for the parent LinearLayout.

The accepted answer to this SO post explains its significance => What does "xmlns" in XML mean?

Community
  • 1
  • 1
kkaosninja
  • 1,301
  • 11
  • 21