What i want to do is , allow user to swipe and refresh the list, it does not matter if the data is there or not. But when data is there in the listview only the listview sho
I had this issue too, and solved it without any additional code in the activity by using the layout below.
If you are using a ListActivity
or ListFragment
it handles showing/hiding the empty view for you, and refreshing works with an empty list as well with this layout structure.
No hacks needed, everything is in the SwipeRefreshLayout
, as it should be.
Hope it helps anyone struggling with this issue.