0

I am using cwac's EndlessAdapter and I set TextView with some text to ListView via setEmptyView method. Standard behaviour for android is: While ListView does not have adapter or adapter's data set is empty then show empty view.

This is obviously not true with EndlessAdapter because when dataset is empty then nothing is shown. (Dataset can be empty in cases when user performed server search but there were no results etc.)

Any ideas to make it working?

Thanks :)

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
bakua
  • 13,704
  • 7
  • 43
  • 62
  • EmptyListView may not show because of your xml layout file. Try setting your ListView's height attribute to **wrap_content**. – Marko Sep 02 '14 at 09:13
  • Unfortunately no. Setting ListView's height to wrap_content does not help :/ My xml layout file is pretty standard one, just LV and TV in one RelativeLayout. It works this way everywhere else without EndlessAdapter. – bakua Sep 02 '14 at 09:21
  • Try some of the answers from this SO question: http://stackoverflow.com/questions/12483508/setemptyview-on-listview-not-showing-its-view-in-a-android-app If noone will help, I would ask @CommonsWare, he could help you, since he is the creator of the library :) – Marko Sep 02 '14 at 09:36
  • As is noted on [the CWAC-Endless project page](https://github.com/commonsguy/cwac-endless), that project is discontinued. Since you know whether the adapter is empty, don't set an empty `EndlessAdapter` on the `ListView`, and you should still get the empty view. Only put an `EndlessAdapter` on a `ListView` if it actually has data *and* needs endless capability (just set the inner adapter on the `ListView` if you know ahead of time that there is no more data to fetch). IOW, `EndlessAdapter` is a decorator to be used on occasion, not all the time. – CommonsWare Sep 02 '14 at 11:52

0 Answers0