Kenny Freeman Kenny Freeman - 4 months ago 22
Android Question

titleTextView not defined

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.

enter image description here

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.

PhotoPageFragment.java

Is there something I'm overlooking here?

Answer

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"

Comments