Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a ListView which is getting populated from service response. When service is called i am showing a progressbar by adding footerview by inflating progressbar view and hiding it once listview is populated.

Note: I am adding footerview before setting adapter. Then i am adding footerview at each service call.

problem: when service returns non empty response everything is working fine(footerview is shown and hided after listview is populated) when service response is empty i.e. listview is empty in next method calls to addFooterView() not working(not showing footerview).

Following is sample code

addFooterView(loadingView, null, false);
m_List.addAll(listItems);
m_adapter.notifyDataSetChanged();
removeFooterView(loadingView);

Note: If each time list size is greater than zero i am not facing problem.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
180 views
Welcome To Ask or Share your Answers For Others

1 Answer

add footer view if your arraylist has data that is binding to your adapter and also check listView.getFooterViewCount before adding if it is already has.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...