java.lang.ClassCastException: android.widget.HeaderViewListAdapter cannot be cast to com.android.mms

解决方案:

                ListView listView = getListView();
                //ConversationListAdapter adapter = (ConversationListAdapter) listView.getAdapter();
    ConversationListAdapter adapter = null;
    if(listView.getAdapter() instanceof HeaderViewListAdapter) {
    HeaderViewListAdapter listAdapter=(HeaderViewListAdapter)listView.getAdapter();
adapter = (ConversationListAdapter) listAdapter.getWrappedAdapter();
    } else {
    adapter = (ConversationListAdapter) listView.getAdapter();
    }    

你可能感兴趣的:(java.lang.ClassCastException: android.widget.HeaderViewListAdapter cannot be cast to com.android.mms)