我之前在片段中所做的是:
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?
}