Fixed
Status Update
Comments
ad...@google.com <ad...@google.com> #2
What are you trying to do? Can you include a sample project that reproduces your issue?
ki...@google.com <ki...@google.com> #3
I use a custom Dialog navigator that doesn't allow 2 dialogs open at the same time. I'll create a sample project in the next few days
al...@google.com <al...@google.com> #4
Sample project here: https://github.com/rubensousa/CustomNavigatorSample
Crash on 2.3.2:
Caused by: java.lang.ClassCastException: com.navigation.sample.SingleDialogNavigator cannot be cast to androidx.navigation.fragment.DialogFragmentNavigator
at androidx.navigation.fragment.NavHostFragment.onAttachFragment(NavHostFragment.java:293)
Expected behavior: no crash as in 2.3.1
Crash on 2.3.2:
Caused by: java.lang.ClassCastException: com.navigation.sample.SingleDialogNavigator cannot be cast to androidx.navigation.fragment.DialogFragmentNavigator
at androidx.navigation.fragment.NavHostFragment.onAttachFragment(NavHostFragment.java:293)
Expected behavior: no crash as in 2.3.1
ap...@google.com <ap...@google.com> #5
Any update on this? This is preventing us from updating to newer releases
hu...@google.com <hu...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
commit ffe68e0a3be1da83217fadd4e40c5abad4f72b82
Author: Ian Lake <ilake@google.com>
Date: Tue Apr 06 12:40:35 2021
Use FragmentOnAttachListener in DialogFragmentNavigator
Rather than having the NavHostFragment
explicitly look for the DialogFragmentNavigator
to forward the fragment attach callback,
have DialogFragmentNavigator use the
Fragment 1.3 FragmentOnAttachListener API
to fully contain that logic within the
DialogFragmentNavigator.
Relnote: "`NavHostFragment` now supports custom
Navigators that use the same `@Navigator.Name(\"dialog\")`
as the default `DialogFragmentNavigator`."
Test: existing tests still pass
BUG: 175979140
Change-Id: Ib1c2cc38e7a621d133be1f4c3692e62913450dda
M navigation/navigation-fragment/api/public_plus_experimental_current.txt
M navigation/navigation-fragment/src/main/java/androidx/navigation/fragment/DialogFragmentNavigator.kt
M navigation/navigation-fragment/src/main/java/androidx/navigation/fragment/NavHostFragment.kt
https://android-review.googlesource.com/1665820
Branch: androidx-main
commit ffe68e0a3be1da83217fadd4e40c5abad4f72b82
Author: Ian Lake <ilake@google.com>
Date: Tue Apr 06 12:40:35 2021
Use FragmentOnAttachListener in DialogFragmentNavigator
Rather than having the NavHostFragment
explicitly look for the DialogFragmentNavigator
to forward the fragment attach callback,
have DialogFragmentNavigator use the
Fragment 1.3 FragmentOnAttachListener API
to fully contain that logic within the
DialogFragmentNavigator.
Relnote: "`NavHostFragment` now supports custom
Navigators that use the same `@Navigator.Name(\"dialog\")`
as the default `DialogFragmentNavigator`."
Test: existing tests still pass
BUG: 175979140
Change-Id: Ib1c2cc38e7a621d133be1f4c3692e62913450dda
M navigation/navigation-fragment/api/public_plus_experimental_current.txt
M navigation/navigation-fragment/src/main/java/androidx/navigation/fragment/DialogFragmentNavigator.kt
M navigation/navigation-fragment/src/main/java/androidx/navigation/fragment/NavHostFragment.kt
pa...@google.com <pa...@google.com> #7
In the upcoming Navigation 2.4.0-alpha01
, we've updated our Fragment dependency such that we can use the 1.3.0
FragmentOnAttachListener
to handle the case where previously the NavHostFragment
needed to be involved. Thus, NavHostFragment
no longer needs to cast the Navigator returned by the dialog
name to DialogNavigator
.
As a workaround, your custom Navigator can use any name other than dialog
(say, singleDialog
) and it'll work just fine if you use that instead of dialog
.
Description
Exception:
Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.core.os.ResultReceiver"
ResultReceiver in AndroidX Core, it is still in package android/support/v4/os:
Sample project:
Android Studio:
Android Studio 3.3
Build #AI-182.5107.16.33.5199772, built on December 25, 2018
JRE: 1.8.0_152-release-1248-b01 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.6