ListView listView = findViewById(R.id.list_view); TextView emptyView = findViewById(R.id.empty_view); listView.setEmptyView(emptyView); // Set the adapter for the list view here
ListView listView = findViewById(R.id.list_view); View emptyView = getLayoutInflater().inflate(R.layout.empty_view, null); listView.setEmptyView(emptyView); // Set the adapter for the list view herePackage library: android.widget