导航SlideMenu甚至onChildClick ExpanListview挂钩

时间:2016-07-06 10:39:26

标签: javascript java c# android

我在android上使用展开ListView导入滑动菜单库。但是如果onChildClick甚至在expandListView上它就会出现问题。然而它并没有崩溃,但它让用户感到不舒服 请你帮我 对不起,因为英语不够好。

这是我的代码:

expanListView.setOnChildClickListener(new
ExpandableListView.OnChildClickListener() {

     @Override
     public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {

        switch (groupPosition) {
            case 0:
                break;
            case 1:
                break;
            case 2:
                break;
            case 3:
                if(childPosition==1)
                {
                    MotoListFragment fragment1 = new MotoListFragment();
                    getActivity().getSupportFragmentManager().beginTransaction()
                            .replace(R.id.item_detail_container, fragment1).addToBackStack(null)
                            .commit();
                    setViewToolBar.upDateListByke();
                    ((MainActivity) getActivity()).toggleMenu();
                }
                else if (childPosition == 0){
                    MaintenanceFragment fragment = new MaintenanceFragment();
                    getActivity().getSupportFragmentManager().beginTransaction()
                            .replace(R.id.item_detail_container,fragment).addToBackStack(null)
                            .commit();
                    ((MainActivity) getActivity()).toggleMenu();
                }
                break;
        }
        return true;
    }
});

0 个答案:

没有答案