I have a listview that is the main part of my activity. When there are no objects in the listview, I want to replace it with a helpful message (a TextView). I simply call setContentView again if the list is unpopulated in onResume.
However, this only works for the TextView. If I call setContentView(R.layout.mylayout)
, then I get a blank. This is especially bothersome after the user has created an item that would properly go into the listview in another activity and returns.
Do I have the right approach? How do I fix this?
Thanks!