Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Application:Error "Found text"

Tags:

android

xml

image

I have been following a book on Android "Beginning Android Application". I have been trying to figure out an application which shows images in a view. But unfortunately I could not run the application because of the following errors:

[2012-04-24 19:37:33 - Gallery] F:\eclipse workspace\Gallery\res\values 
\attrs.xml:2:error: Found text "
[2012-04-24 19:37:33 - Gallery] ​​​​    " where item tag is expected

For convenience I am giving here the codes. main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView  
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:text="Bilai"
/>
<Gallery
android:id="@+id/gallery1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>    
<ImageView
android:id="@+id/image1"
android:layout_width="320px"
android:layout_height="250px"
android:scaleType="fitXY"
/>  
</LinearLayout>

This application requires another xml file. It is named as attrs.xml under res/values. attrs.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
​<declare-styleable name="Gallery1" >
​​​​<attr name="android:galleryItemBackground" />
​​​</declare-styleable>
</resources>

I think the problem lies within attrs.xml, but I dont know whats going on. And because of this the R.styleable also doesnt work either. Please help. Thanks in advance

like image 203
Taslim A. Khan Avatar asked Jun 20 '26 03:06

Taslim A. Khan


1 Answers

I think you have some characters before each line in your attrs.xml due to a copy/past method.

Can you try to reformat your code by placing your text cursor at the beginning of each line and delete to return to previous line ?

like image 136
Alexandre B. Avatar answered Jun 22 '26 16:06

Alexandre B.