I am new to xml and android programming.Here is my xml code… I don’t understand why i get random errors… I tried a lot of things(like changing “/>” with the normal way to end). I also tried an online xml checker but i got the same error so i hope you help me. I get a lot of errors, I know that I should tell you which are but they are so random. Maybe it’s Eclipse’s bug… Idk, thanks for reading this.
<?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:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Your total is 0"
android:textSize="45dp"
android:layout_gravity="center"
android:gravity="center"
android:id="@id/tvDisplay"
/>
<Button
android:layout_width="250dp"
android:layout_height="wrap_content"
android:text="Add one"
android:layout_gravity="center"
android:textSize="20dp"
android:id="@id/bAdd"
/>
<Button
android:layout_width="250dp"
android:layout_height="wrap_content"
android:text="Subtract one"
android:layout_gravity="center"
android:textSide="20dp"
android:id="@id/bSub"
/>
</LinearLayout>
Your id declarations are incorrect:
android:id="@id/bSub".It should be like
android:id="@+id/bSub". Note the “+” sign.