Ogen
Ogen

Reputation: 6709

Android: making emptyView invisible?

I have a 2 list view and I switch between them by making one visible and one invisible.

They both have emptyViews that show when the listView is empty. However, I dont want the emptyView to show if the view is set to invisible regardless of whether it is empty or not.

How can I do this?

Upvotes: 1

Views: 100

Answers (1)

Pankaj Kumar
Pankaj Kumar

Reputation: 83028

You can remove empty TextView from layout. If you don't want, you can do it by pragmatically as

TextView empty = getListView().getEmptyView();
empty.setVisibility(View.GONE);

Upvotes: 2

Related Questions