Fixed
Status Update
Comments
jp...@google.com <jp...@google.com>
ya...@google.com <ya...@google.com> #2
If you need to add a custom Navigator but don't want to subclass NavHost (which we expect will be needed in most cases), the correct approach is to add it before you set your graph:
1) Don't use app:navGraph in your XML
2) Get a reference to your NavController
3) Add your Navigator to the NavController
4) Call setGraph on the NavController
This relies on the fact that NavController waits until the graph is set before restoring state / doing anything at all.
Technically, the createFragmentNavigator() call in NavHostFragment is already called at the same time as your proposed onNavControllerCreated() method so as a workaround, you could override that method, add your Navigator, then return super.createFragmentNavigator().
1) Don't use app:navGraph in your XML
2) Get a reference to your NavController
3) Add your Navigator to the NavController
4) Call setGraph on the NavController
This relies on the fact that NavController waits until the graph is set before restoring state / doing anything at all.
Technically, the createFragmentNavigator() call in NavHostFragment is already called at the same time as your proposed onNavControllerCreated() method so as a workaround, you could override that method, add your Navigator, then return super.createFragmentNavigator().
ya...@google.com <ya...@google.com>
ko...@google.com <ko...@google.com>
ko...@google.com <ko...@google.com> #3
The first solution does not work, because after screen rotation, the graph (probably a restored graph) is set when Activity.setContentView() is called.
The workaround with createFragmentNavigator() works, though it's not very elegant. Maybe the method could be renamed to createNavigators() and return a list or an array of Navigators?
Anyway, it is a good enough solution for now, so it is not very urgent.
In conclusion:
* I think that a better support for custom destinations should be provided before final release.
* I would suggest describing the "Add support for new destination types" section in the documentation in more details.
Thank you
The workaround with createFragmentNavigator() works, though it's not very elegant. Maybe the method could be renamed to createNavigators() and return a list or an array of Navigators?
Anyway, it is a good enough solution for now, so it is not very urgent.
In conclusion:
* I think that a better support for custom destinations should be provided before final release.
* I would suggest describing the "Add support for new destination types" section in the documentation in more details.
Thank you
Description
The following Vulkan related problems were found on emulator 35.1.18 and emu-master-dev.
While running android emulators with big parallelism (10+ instances in parallel) i've noticed that occasionally there are errors like:
which do seem to affect the succeeding sessions. Most likely it could be a problem in the gpu vulkan library or smth else, but the issue is that I'm running the emulators withhttps://android.googlesource.com/platform/external/qemu/+/refs/heads/emu-master-dev/android/android-ui/modules/aemu-gl-init/src/android/opengl/emugl_config.cpp#246 )
-feature -Vulkan
to turn of Vulkan in order to be able to use snapshots, but nevertheless some Vulkan APIs are called (as seen from the error) which seems to cause issues at my scale. The problematic place seems to beemuglConfig_get_vulkan_hardware_gpu
inexternal/qemu/android/android-ui/modules/aemu-gl-init/src/android/opengl/emugl_config.cpp
(stack:
For now I've been able to get around this by renaming the
vulkan
folder underlib64
so that no Vulkan API calls are ever made (the flow just stops since it cannot load the library), but could it be possible to adjust this so that-feature -Vulkan
really disabled Vulkan.Another much smaller related issues is that even with
-feature -Vulkan
, the following lines are logged:This seems to come fromhttps://android.googlesource.com/platform/external/qemu/+/refs/heads/emu-master-dev/android/android-ui/modules/aemu-ui-window/src/android/main-common-ui.c#315 ) which does not seem to honour the feature flag (eventually Vulkan is not used since lower in the logic it does check the override state, but that could have been done at the very start to avoid the confusing log messages).
main-common-ui.c
(