当前位置:网站首页>Navigate back to fragmentpageradapter - & gt; Fragment is empty - navigating back to fragmentpageradapter - & gt; fragments are empty
Navigate back to fragmentpageradapter - & gt; Fragment is empty - navigating back to fragmentpageradapter - & gt; fragments are empty
2022-06-30 05:48:00 【fyin1314】
problem :
I have a Fragment (I'll call it pagerFragment ) that is added to the backstack and is visible. I have one Fragment( I call it pagerFragment ), It is added to backstack And it's visible .It holds a viewPager with a FragmentPagerAdapter . It has a with FragmentPagerAdapter Of viewPager .The FragmentPagerAdapter holds (let's say) two fragments: A and B.FragmentPagerAdapter contain ( hypothesis ) Two clips :A and B.
First adding of the fragments works great. First of all, adding clips works well .
Fragment A has a button that once clicked, adds a fragment (C) to the backstack. fragment A There's a button , When you click the button , The clip (C) Add to backstack.
The problem is this: if I add that fragment (C), and then click back, the pagerAdapter is empty, and I cannot see any fragments inside. The problem is that : If I add that clip (C), Then click back , pagerAdapter It's empty. , I can't see any clips in it .
If I use a hack, and destroy the children fragments (A and B) in the pagerFragment s onDestroyView() , this solves the problem, although I don't wan't to use this hack. If I use hack And destroy pagerFragment s onDestroyView() Sub segments of (A and B onDestroyView() , This can solve the problem , Although I don't want to use this hack.
Any ideas what the issue could be? Any idea may be a problem ?
Solution :
Reference resources : https://stackoom.com/en/question/1C9Up边栏推荐
- Solitidy - fallback 回退函数 - 2种触发执行方式
- [untitled] user defined function
- 动态规划--怪盗基德的滑翔翼
- Stack overflow caused by C # using protobuf stack overflow
- [chestnut sugar GIS] global mapper - how to assign the elevation value of the grid to the point
- At the age of 32, I fell into a middle-aged crisis and finally quit naked...
- 86. separate linked list
- Transfer the token on the matic-erc20 network to the matic polygon
- Leader: who can use redis expired monitoring to close orders and get out of here!
- 旋转框目标检测mmrotate v0.3.1入门
猜你喜欢

Redistemplate common method summary
![09- [istio] istio service entry](/img/48/86f8ec916201eefc6ca09c45a60a6a.jpg)
09- [istio] istio service entry

Codeforces C. Andrew and Stones

9. naive Bayes

Dao -- a beautiful new world?

Use of OpenCL thread algebra library viennacl

What do you think of the deleted chat records? How to restore the deleted chat records on wechat?

Shenzhou ares tx6 boot logo modification tutorial

【LeetCode】Easy | 225. Using queue to realize stack (pure C manual tearing queue)

声网,站在物联网的“土壤”里
随机推荐
Responsive flow layout
Huxiaochun came to fengshu electronics to sign a strategic cooperation agreement with Zoomlion
On line assignment of financial cost management in the 22nd spring of Western Polytechnic University [Full Score answer]
Voting vault: a new primitive for defi and Governance
[secretly kill little partner pytorch20 days] - [day4] - [example of time series data modeling process]
1380. lucky numbers in matrices
STM32F103系列控制的OLED IIC 4针
Today, Ali came out with 35K. It's really sandpaper that wiped my ass. it showed me my hand
Responding with flow layout
/Path/to/ idiom, not a command
聲網,站在物聯網的“土壤”裏
09- [istio] istio service entry
如何写论文
【板栗糖GIS】global mapper—如何把栅格的高程值赋予给点
hashlips_ art_ Engine-1.0.6 usage
Force deduction exercise -- deleting repeated items in ordered sequence 1.0
token 过期后,如何自动续期?
What indicators should safety service engineers pay attention to in emergency response?
C. Divan and bitwise operations
[road of system analyst] collection of wrong topics in Project Management Chapter