1

I am creating an android app which uses a schedule_layout.xml file located under the res folder but I'm getting this error, "Android is missing Android namespace prefix". What does it mean? How can I fix it?

<?xml version="1.0" encoding="utf-8"?>
<ListView
    android:id="@+id/schedule"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">
</ListView>
Saravanan
  • 363
  • 1
  • 14
Enoinochi
  • 63
  • 12

2 Answers2

2

add the following attribute to your list view:

"xmlns:android="http://schemas.android.com/apk/res/android"

it's like a namespace declaration

what is sleep
  • 916
  • 4
  • 12
1

Use the below

<?xml version="1.0" encoding="utf-8"?>
<ListView
    xmlns:android="http://schemas.android.com/apk/res/android" //missing
    android:id="@+id/schedule"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">
</ListView>

Also check this

Why this line xmlns:android="http://schemas.android.com/apk/res/android" must be the first in the layout xml file?

Community
  • 1
  • 1
Raghunandan
  • 132,755
  • 26
  • 225
  • 256