I am populating a ListActivity's ListView using an ArrayAdapter extended to apply some conditions to the data it returns. It's possible for the adapter to return an empty set for several possible reasons and as those conditions are set by the user, I'd like to feed back info using setText() on the android:empty view. In the ListActivity (both before and after the setListAdapter) I've tried
TextView t = new TextView(this);
t.setText("HEY!");
getListView().setEmptyView(t);
and also
getListView().getEmptyView().setVisibility(View.GONE);
TextView t = new TextView(this);
t.setText("HEY!");
((ViewGroup)getListView().getParent()).addView(t);
getListView().setEmptyView(t);
but I only get the message set in the layout android:empty.
Thanks!