I need to dynamically footer which can be add or remove when ever scrollview reaches the end. at some point I also need it to be visible and at other times I need it to be invisible , since I can't change visibility is there any other way.
I am having an on scroll listener like this
listViewComments.setOnScrollListener(new AbsListView.OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView absListView, int i) {
if (i == AbsListView.OnScrollListener.SCROLL_STATE_IDLE
&& (listViewComments.getLastVisiblePosition() - listViewComments.getHeaderViewsCount() -
listViewComments.getFooterViewsCount()) >= (commentAdapter.getCount() - 1)) {
// removing or adding footer
}
}
when I do like this it results in flickering of the footer even if I am calling the function once, sometimes when I scroll it gets in the middle of my listview items.