Reputation: 27
I'm working on a Lab for my class and can't figure out what is wrong with this xml. I keep getting an error.
If I hover over the xml it tells me The id titleTextView
is not defined anywhere.
Here is the xml.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/titleTextView"
android:layout_alignParentTop="true" />
<TextView
android:="@id/titleTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_above="@+id/progressBar" />
<ProgressBar
android:id="@id/progressBar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:visibility="invisible"
style="?android:attr/progressBarStyleHorizontal" />
</RelativeLayout>
When I first did it I had it misspelled and thought that it may have saved it somewhere I wasn't aware of. I've tried cleaning the project and deleting the xml file. I'm using it in a class here.
Is there something I'm overlooking here?
Upvotes: 0
Views: 435
Reputation: 191874
The error points you at Line 14.
Where you have android:="@id/titleTextView"
Compared to the correct line android:id="@id/titleTextView"
or android:id="@+id/titleTextView"
Upvotes: 3
Reputation: 406
Replace this line
android:="@id/titleTextView"
to
android:id="@+id/titleTextView"
Upvotes: 1
Reputation: 20211
When you're creating an id, it needs to have a +
:
@+id/titleTextView
Upvotes: 1