Let me answer the second question first, because that is more straightforward.
The problem is that when you set you custom click listener, it overrides the default one of the list.
So, what you need to do is first check for the child count. If the count is zero, then only add the listener.
if ( getChildrenCount( groupPosition ) == 0 )
convertView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Toast.makeText(_context, "No data available", Toast.LENGTH_SHORT).show();
}
});
Now, coming back to the first question. I am assuming that you have a dataset in which you store all the elements. Before you create the adapter for the expandable listview, loop through the dataset and remove all the elements which don't have any children. After this, create the adapter from the dataset.