Fixed
Status Update
Comments
jb...@google.com <jb...@google.com>
cl...@google.com <cl...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
Author: Clara Fok <
Link:
Fix ActivityNavigator not encoding with NavType
Expand for full commit details
Fix ActivityNavigator not encoding with NavType
When navigating with dynamic arugments, ActivityNavigator should first try to encode the argument value with the associated NavType. If NavType is not present (XML file has dataPattern but not arguments added) then we should fallback to existing behavior of just encoding the arg value with toString().
Test: ./gradlew navigation:navigation-runtime:cC
Bug: 383616432
Relnote: "When navigating to activity with dataPattern, ActivityNavigator will now try to encode the arg value with the argument's NavType."
Change-Id: I163763c46090ae9b4c8ee75d52142986e507c0c3
Files:
- M
navigation/navigation-runtime/src/androidTest/java/androidx/navigation/ActivityNavigatorTest.kt
- M
navigation/navigation-runtime/src/main/java/androidx/navigation/ActivityNavigator.kt
Hash: ad1ddb7df46854191c753e309e72216fae9309de
Date: Mon Jan 06 15:51:40 2025
cl...@google.com <cl...@google.com> #3
Fixed internally and available in navigation 2.9.0-alpha05
na...@google.com <na...@google.com> #4
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.navigation:navigation-runtime:2.9.0-alpha05
androidx.navigation:navigation-runtime:2.8.6
Description
Component used: Navigation
Version used: 2.8.5
When fills in the
ActivityNavigator
intent.data
, it seems to directly callUri.encode(args[argName].toString())
, thus bypassing any of theNavType
specific logic for serializing the value into a String.