I am building a dynamic view in a non-activity class, which is called by my activity class to populate a section of my main view. My problem occurs within this "sub view"

I have an onclicklistener which adds items to a listview, but I cannot call notifydatasetchanged on the adapter from the onclicklistener, because the adapter object needs to be declared final, which won't work.

What am I doing wrong?

Here's my code: (I would like to notifydatasetchanged right after newComment(o) )