2016-08-13 13 views

回答

0

首先動態地添加片段,然後替換象下面這樣: -

FragmentTransaction ft = getActivity().getFragmentManager().beginTransaction(); 
SectionDescriptionFragment bdf = new SectionDescriptionFragment(); 
ft.replace(R.id.book_description_fragment, bdf); 
ft.commit(); 
+0

動態地添加片段可以按照http://wptrafficanalyzer.in/blog/dynamically-add-fragments-to- an-activity-in-android/ – Ramit

+0

什麼是'SectionDescriptionFragment'? – MakPo

+0

僅限其示例。你可以使用你自己的片段名稱,類似於鏈接中提到的例子。 – Ramit

相關問題