waffiqaziz / BAZZ-Movies

Movies Catalog Android App
https://waffiqaziz.github.io/bazzmovies
Apache License 2.0
1 stars 0 forks source link

Search view on Search Fragment not shows up when navigate back quickly #22

Closed waffiqaziz closed 2 months ago

waffiqaziz commented 2 months ago

Issue: When navigating back and forth quickly in the Search Fragment, the MenuProvider setup is not fully re-executed, causing the SearchView to remain uninitialized or missing. This results in the search bar not showing up.

Steps to Reproduce:

  1. Navigate to the Search Fragment.
  2. Quickly navigate away and then back to the Search Fragment.
  3. Observe that the SearchView does not appear.

Expected Behavior: The SearchView should always be displayed when returning to the Search Fragment, regardless of navigation speed.

Actual Behavior: The SearchView sometimes fails to appear due to incomplete re-execution of the MenuProvider setup.

Proposed Solution: Ensure that the MenuProvider setup is consistently executed even during quick navigation transitions to properly initialize the SearchView.

waffiqaziz commented 2 months ago

The issue occurs because of the toolbar being detached via onDestroy() which resulted interfere with the toolbar state. As a result, detached toolbar moved to the MainActivity