I’ve made a customAdapter that accepts an ArrayList. The ArrayList contains a title and then a link.
For example: [Title1, http://mylink1.com/, Title2, –http://mylink2.com/-, Title3, –http://mylink3.com/- …] ** I’ve put hypens there because of the “Stackoverflow” Spam filter.
I’m wanting to display the title and then have the on click listener to have the link. I’m having trouble however figuring out a way to do this. Any help would be greatly appreciated! 🙂
The ArrayList needs to contain Link objects.
Ex.
In getView of your Adapter you would use the title to fill the TextView, and in the onClick on onSelect or whatever, you would have the Link object with the title and url.
Ex.
And if your Adapter extends ArrayAdapter and you aren’t overriding getView(), then the toString() method of Link needs to return the title field.