我正在使用带有片段的FragmentPagerAdapter。我的问题是,当我调用setCurrentItem时,正在加载的片段的OnCreateView方法会被调用两次。重要的是要注意,片段并没有重新创建,只是恢复了。我迫切需要找到一个解决方案,使OnCreateView仅被调用一次。
我已经查看了以下几个问题和更多问题,但它们都没有针对我的情况提供答案: Android oncreateview called twice OnCreateView called multiple times / Working with ActionBar and Fragments Fragment onCreateView and onActivityCreated called twice 我发现的大多数问题与FragmentViewPagers无关,因此它们大多没有帮助。
非常感谢您的任何帮助!
我已经查看了以下几个问题和更多问题,但它们都没有针对我的情况提供答案: Android oncreateview called twice OnCreateView called multiple times / Working with ActionBar and Fragments Fragment onCreateView and onActivityCreated called twice 我发现的大多数问题与FragmentViewPagers无关,因此它们大多没有帮助。
非常感谢您的任何帮助!