-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty view cannot be set while there is no items in the list #13
Comments
The PullToRefreshListView does not override #setEmptyView of ListView, so you can just use http://developer.android.com/reference/android/widget/AdapterView.html#setEmptyView(android.view.View) or set the empty view in XML like you would on any other regular ListView. |
I have to agree that this is a bug. When using setEmptyView, you lose the functionality to pull to refresh when the list is indeed empty. Also it is very gltchy when refreshing (as the list goes empty for a brief second while updating and you see the empty view). |
Yes, you are right. I'm re-opening the issue and will look into it ASAP. |
I thought I'd just go ahead and put my solution: In PullToRefreshListView add the following: private TextView emptyView;
//modify //in init() add
//add this method - this can be refactored to use styles public void setNoItemsText(String noItemsText) { public void setEmtpyView(TextView view) { This can be refactored but simply gives a default empty view with a modifiable TextView |
a pull request >? |
A pull request would be nice... |
I need the setEmptyView functionality and would be really happy if it´s solved. The solution vincentjames501 provided works, but not initially. The list is empty from the beginning and the text is not shown until a refresh is done. I want to tell the user that he needs to refresh. I tried to call the onRefreshComplete() manually but it will not update the header for some reason? |
When there is no items in the list view i have to set an emptyview .In the current code there is no option to set an empty view .
The text was updated successfully, but these errors were encountered: