-1

Here is my XML code:

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

    <TextView
        android:layout_width="match_parent"
        android:layout_height="250dp"
        android:background="#efefef"
        android:padding="10dp"
        android:textSize="48sp"
        android:text="123456"
        android:gravity="end|bottom"
        />


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        >
        <Button
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"/>

  </LinearLayout>

Please help me out

I have tried restarting the IDE but it isnt helping. I am not also getting autofill suggestion when i type in IDE.

1 Answers1

1

Your XML is not formatted correctly since you do not have a closing tag for your outer LinearLayout.

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

    <TextView
        android:layout_width="match_parent"
        android:layout_height="250dp"
        android:background="#efefef"
        android:padding="10dp"
        android:textSize="48sp"
        android:text="123456"
        android:gravity="end|bottom"
        />


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        >
        <Button
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"/>

  </LinearLayout>
</LinearLayout> /// <------------- This
tomerpacific
  • 4,704
  • 13
  • 34
  • 52