I\'m really having trouble using the setEmptyView method. I tried it to implement it in GridView and ListView, but both of them didnt work. Here a sample codeblock:
You can define external XML layout files, inflate and set it as an empty view. Only thing to remember is to set the parent of the inflated view.
View emptyView = inflater.inflate(R.layout.id_of_your_layoout_file, parent, false); gridView.setEmptyView(emptyView);
or
listView.setEmptyView(emptyView);