第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何將getChildFragmentManager與擴展Dialog片段的類一起使用

如何將getChildFragmentManager與擴展Dialog片段的類一起使用

繁星點點滴滴 2021-05-06 10:19:57
我正在使用TabLayout播放片段。一旦我從TabLayout片段移動到下一個片段,然后按返回鍵。默認的TabLayout片段上的內容消失了。我在帖子中找到了可能的解決方案。以下是TabLayout的代碼。public class IndividualCollectionSheetFragment extends MifosBaseFragment {private TabLayout tabLayout;private ViewPager viewPager;private View rootView;public IndividualCollectionSheetFragment() {}public static IndividualCollectionSheetFragment newInstance() {    Bundle args = new Bundle();    IndividualCollectionSheetFragment fragment = new IndividualCollectionSheetFragment();    fragment.setArguments(args);    return fragment;}@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);}@Nullable@Overridepublic View onCreateView(LayoutInflater inflater,                         @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {    rootView = inflater.inflate(R.layout.fragment_individual_recycler, container, false);    ButterKnife.bind(this, rootView);    setToolbarTitle(getStringMessage(R.string.individual_collection_sheet));    viewPager = rootView.findViewById(R.id.viewpager);    setupViewPager(viewPager);    tabLayout = rootView.findViewById(R.id.tabs);    tabLayout.setupWithViewPager(viewPager);    return rootView;}帖子中的解決方案建議使用getChildFramentManager而不是getSupportFragmentManager。我一改成getChildFragmentManager。我得到了錯誤。        java.lang.IllegalStateException: Fragment CollectionSheetDialogFragment{572dd42 #0 Identifier Dialog Fragment} declared target fragment NewIndividualCollectionSheetFragment{45e8153 #0 id=0x7f090361 android:switcher:2131297121:0} that does not belong to this FragmentManager!這可能是由于擴展了DialogFragment的CollectionSheetDialogFragment類造成的,并且與所使用的不同片段管理器之間必須存在不一致之處。
查看完整描述

2 回答

?
婷婷同學_

TA貢獻1844條經(jīng)驗 獲得超8個贊

也許這項工作:替換 getFragmentManager() 而不是getChildFragmentManager()


查看完整回答
反對 回復 2021-05-19
  • 2 回答
  • 0 關注
  • 269 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號