是否可以找到ExpandableListView中的第一个可见项是GroupIndicator视图还是其下的childView?请帮助

预先感谢

最佳答案

终于设法做到了

int firstVisibleItem =  mExpListView.getFirstVisiblePosition();

long data = mExpListView.getExpandableListPosition(firstVisibleItem);
int type = mExpListView.getPackedPositionType(data);
if (type ==    ExpandableListView.PACKED_POSITION_TYPE_CHILD) {
    Log.i("info", "childindicator");
}else
    Log.i("info", "groupindicator");

07-27 17:31