I am using a listview and I have setup the empty view for the list view as follows:
Using java Syntax Highlighting
- TextView emptyListTextView = new TextView(this);
- emptyListTextView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT));
- emptyListTextView.setId(android.R.id.empty);
- emptyListTextView.setText("Empty"
- userListView = (ListView) findViewById(android.R.id.list);
- userListView.setEmptyView(emptyListTextView);
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
but nothing appears when the list is empty. I have not defined the empty view in the xml file, but am adding the empty view like above.
Please help.
Regards,
Prashant




