Create id for a new ListView?

1

I have the following problem, I already have a listView and I want to create another, but it is giving the following error:

 <ListView
        android:id="@android:id/listView" <----- ***Error: No resource found that matches the given name (at 'id' with value '@android:id/listView').***
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" >
    </ListView>
    
asked by anonymous 26.01.2015 / 12:45

1 answer

2

Using the @android: prefix indicates that you are trying to reference a resource directly from the imported android SDK in your project.

Following the documentation:

@[<nome_do_pacote>:]<tipo_resource>/<nome_resource>

<nome_do_pacote> is the name of the package that the resource is allocated. You do not have to indicate if the resource is from the same package as your project.

<tipo_resource> is a subclass of the file R of resuorce

<nome_resource> or is the name of your resource (without the extension) or the android:name attribute of the element in XML

That is, instead of @android:id/listView , put @+id/listView and it will work!

    
26.01.2015 / 12:58