如何将NavigationDrawerPageSlidingTabStrip与StickyListHeaders库结合起来?

时间:2014-12-25 15:01:40

标签: android listview

我是android的初学者。请问,您能解释一下如何将Navigation-drawer-page-sliding-tab-strip库与StickyListHeaders库结合起来。我需要为viewPager上的每个页面加载一个listview(StickyListHeader)。

我正在尝试,但我在logcat上遇到错误:" java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first."

谢谢!

1 个答案:

答案 0 :(得分:0)

感谢@Eugen,但我已经在onCreateView方法中找出了PageContentStripFragment Class中的膨胀模式问题:

        view = inflater.inflate(R.layout.fragment_test, container, false);
        StickyListHeadersListView stickyList = (StickyListHeadersListView) view.findViewById(R.id.list);
        stickyList.setOnItemClickListener(this);
        stickyList.setOnHeaderClickListener(this);
        mAdapter = new HeaderListAdapter(getActivity());
        stickyList.setAdapter(mAdapter);