当我在BaseExpandableListAdapter中时,如何附加我的YouTubePlayerSupportFragment?

时间:2017-01-23 23:21:32

标签: android android-youtube-api

我之前在片段中所做的是:

YouTubePlayerSupportFragment youTubePlayerFragment = YouTubePlayerSupportFragment.newInstance();

youTubePlayerFragment.initialize(/* .. */);
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
transaction.add(R.id.fl_youtube, youTubePlayerFragment).commit();

这很好用。但是现在我有一个BaseExpandableListAdapter来设置getChildView中展开的内容。没有getChildFragmentManager。我现在该怎么办?

public View getChildView(int groupPosition, 
                         int childPosition, 
                         boolean isLastChild, 
                         View convertView, 
                         ViewGroup parent) {
   // How do I add attach the YouTubeFragment?
}

0 个答案:

没有答案