I have an Activity extends ListActivity, where I had to create a ListView programmatically (no xml).
To set up an emptyView for it the only way that worked was the following code I found in another thread:
TextView emptyView = new TextView(this);
((ViewGroup) getListView().getParent()).addView(emptyView);
getListView().setEmptyView(emptyView);
now my goal is to do the same using a layout instead of a TextView, so I made an xml with its id and put it this way:
View emptyView = findViewById(R.id.empty_view_xml);
((ViewGroup) getListView().getParent()).addView(emptyView);
getListView().setEmptyView(emptyView);
but it doesn't seem to work..