Skip to content

Dealing with Multiple Fragments in a ViewPager #22

Open

Description

@irvine752

I have a couple of fragments in a viewPager2. Two of the fragments have persistent search views. When I toggle back & forth between the fragments, tapping to activate the search query does not work.

I was thinking it's related to the Lifecycle of the fragments which toggles between pause & resume depending on which fragment is active. Do we need to do anything special when multiple instances of the persistent search views are active at a time?

Activity

  1. mars885 commented on Oct 27, 2021

    @mars885
    Owner

    Hello.

    Can you set up a sample repo project and send me a link so that I could take a look?

    Thanks.

  2. mars885 commented on Nov 17, 2021

    @mars885
    Owner

    @artemius30 Thanks for sharing your solution. However, it's more like a workaround and the behavior is definitely not right. I suspect that there might be some issue with loosing focus over the PersistentSearchView.

    If someone can set up a reproducible repo and send me a link to it so that I could take a look when I have time, I'll be extremely thankful.

  3. irvine752 commented on Nov 24, 2021

    @irvine752
    Author

    Thanks for the update on this issue. @artemius30 saw the same issue as I did. Do we have any update on a potential fix so far? For now, I will update my code to use the fix mentioned above.

    I was also wondering if there's a way to customize or remove the speech to text Google warning.

  4. irvine752 commented on Dec 12, 2021

    @irvine752
    Author

    @mars885 Any updates so far?
    @artemius30 Can the patch be used with ViewBinding? I'm not sure if it's possible to reinitialize the SearchView.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions