0

Hello i'm new in Android Programming Currently i'm practicing TableLayout but somehow there's an strange error.

error: Error parsing XML: unbound prefix

This is my code.

<?xml version="1.0" encoding="utf-8"?>
<TableLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#004400"
>

Need help for find the error

Thank you for your attention

Randy Adhitama
  • 227
  • 1
  • 6
  • 15

3 Answers3

0

Try changing the last line from:

>

to

/>
Gabriel Huff
  • 743
  • 1
  • 6
  • 18
0

add this two line in your main layout:- xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto"

frequent issues arising in android view, Error parsing XML: unbound prefix

Community
  • 1
  • 1
pRaNaY
  • 24,642
  • 24
  • 96
  • 146
0

"Unbound prefix" error here:

andorid:gravity="Center"

you have a typo with andorid.

For the follow-up problem: You can only have only one root-level element in a XML file. Don't self-close your initial TableLayout with the /> at the end but keep it open with >, and close with </TableLayout> at the end, with nothing following it.

laalto
  • 150,114
  • 66
  • 286
  • 303