当前位置:网站首页>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边栏推荐
- I have been working as a software testing engineer for 5 years, but I was replaced by an intern. How can I improve myself?
- Solidy - fallback function - 2 trigger execution modes
- PKCs 12:personal information exchange syntax v1.1 translation part I
- Responsive layout
- OpenCL线程代数库ViennaCL的使用
- Simple use of qlistview of QT (including source code + comments)
- Xi'an Jiaotong automation control theory test simulation question [standard answer]
- Why can transformer break into the CV world and kill CNN?
- Solidity - 安全 - 重入攻击(Reentrancy)
- Expansion method of unity scanning circle
猜你喜欢

Visualization of 3D geological model based on borehole data by map flapping software

The average salary of software testing in 2022 has been released. Have you been averaged?

云服务器部署 Web 项目

8 ways to earn passive income

token 过期后,如何自动续期?

Sword finger offer 22 The penultimate node in the linked list

Database SQL language 03 sorting and paging

Remote sensing image /uda:curriculum style local to global adaptation for cross domain remote sensing image segmentation

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

如何制作CSR(Certificate Signing Request)文件?
随机推荐
Online assignment of C language program design in the 22nd spring of Western Polytechnic University
Shenzhou ares tx6 boot logo modification tutorial
Baiwen.com 7 days Internet of things smart home learning experience punch in the third day
PKCs 12:personal information exchange syntax v1.1 translation part I
UE4_ Editor UMG close window cannot destroy UMG immediately
We strongly recommend more than a dozen necessary plug-ins for idea development
Did you know that WPS can turn on eye protection mode?
Voting vault: a new primitive for defi and Governance
旋转框目标检测mmrotate v0.3.1 学习配置
Array pointers and pointer arrays
Basic operations of C language
Redistemplate common method summary
The average salary of software testing in 2022 has been released. Have you been averaged?
Simple use of qlistview of QT (including source code + comments)
Remote sensing image /uda:curriculum style local to global adaptation for cross domain remote sensing image segmentation
Word frequency statistics (string, list)
/Path/to/ idiom, not a command
Solidy - fallback function - 2 trigger execution modes
Super comprehensive summary | related improvement codes of orb-slam2 / orb-slam3!
About modifying dual system default startup item settings