簡體   English   中英

Android Fragment堆棧和選項卡

[英]Android Fragment backstack and Tabs

我有3個片段-a,b和c。 片段a顯示了一些項目,片段b與片段a相同,片段c包含3個標簽。 當我打開片段A-> b-> c並返回片段b,然后再次打開片段c,然后為每個選項卡打開onCreateView時,不會被調用,所有選項卡都為空白。 誰能幫幫我嗎?

在片段c的onResume中,您不需要執行某些操作,這些操作對於選項卡的內容是必需的。 因此,事實上,在這種情況下什么也不做,因為c僅被暫停了! 所以我的建議是這樣做的:

    @Override
    public void onResume(){
    super.onResume();
    //Paste the same code you have and used in onCreateView() and run again.
    //If nothing happens override onStart and do the same thing!
    //else post some codes so that we can easily figure where the problem is..
    }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM