I have 3 classes representing 3 differents things:
Article,
Photos, and
Videos
All 3 things have 2 properties in common:
A title and and image.
I have an interface called ImageTitleListItem that the 3 classes implement.
That interface is just a getter/setter for title and image
I have 3 classes that are ArrayList:
Articles extends ArrayList<Article>
Photos extends ArrayList<Photo>
Videos extends ArrayList<Video>
I have an ArrayListAdapter that display a list of those images with there title.
The constructor of the ArrayListAdapter receive ArrayList<ImageTitleListItem> as a parameter
When I call it :
adapter = new ArrayListAdapter(Articles)
I have an error:
The constructor ArrayListAdapter(Articles) is undefined
That's normal, so i tried to cast it:
adapter = new ArrayListAdapter((ArrayList<ImageTitleListItem>)Articles)
Now the error is:
Cannot cast from Articles to ArrayList<ImageTitleListItem>
I'm relativly new to java so there's a trick I'm missing, can somebody help me on this.
Thanks