Android Question Initialize a listview

peggjones

Active Member
Licensed User
Longtime User
I have added a listview to an activity via the designer. When I try to add a single line to it it says that I must initialize it first. How can this be? I thought that is exactly what you are not supposed to do.

Thanks
 

thader2012

Member
Licensed User
Longtime User
Hi

It isn't necessary. I think that the name of your listview in the designer not is the same that in your code. You should review the names of the variables.
 
Upvote 0

peggjones

Active Member
Licensed User
Longtime User
The name is definitely the same. I have had to define the listview in a dim statement as well otherwise the program won't compile. The listview is in a second activity not the main one, if this gives a clue.
 
Upvote 0
Top