Fixed
Status Update
Comments
lb...@gmail.com <lb...@gmail.com> #2
Android Studio info:
Android Studio 4.0
Build #AI-193.6911.18.40.6514223, built on May 20, 2020
Runtime version: 1.8.0_242-release-1644-b01 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 12
Registry: ide.new.welcome.screen.force=true, debugger.watches.in.variables=false
Non-Bundled Plugins: String Manipulation, org.jetbrains.kotlin, com.google.services.firebase, com.intellij.marketplace, com.mistamek.drawablepreview.drawable-preview, ignaciotcrespo.github.com.vector-drawable-thumbnails, org.intellij.plugins.markdown
Android Studio 4.0
Build #AI-193.6911.18.40.6514223, built on May 20, 2020
Runtime version: 1.8.0_242-release-1644-b01 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 12
Registry: ide.new.welcome.screen.force=true, debugger.watches.in.variables=false
Non-Bundled Plugins: String Manipulation, org.jetbrains.kotlin, com.google.services.firebase, com.intellij.marketplace, com.mistamek.drawablepreview.drawable-preview, ignaciotcrespo.github.com.vector-drawable-thumbnails, org.intellij.plugins.markdown
lb...@gmail.com <lb...@gmail.com> #3
Possible workaround is to add this to the Activity:
findNavController(R.id.nav_host_fragment).addOnDestinationChangedListener { controller, destination, arguments ->
title = destination.label
}
findNavController(R.id.nav_host_fragment).addOnDestinationChangedListener { controller, destination, arguments ->
title = destination.label
}
il...@google.com <il...@google.com> #4
It looks like the activity needs to add the code from the setupActionBarWithNavController()
and the override of onSupportNavigateUp()
.
il...@google.com <il...@google.com> #5
This specifically applies to the 'Basic Activity' template - the 'Navigation Drawer' and 'Bottom Navigation' templates do this already.
lb...@gmail.com <lb...@gmail.com> #6
Sorry for that. I'm new to navigation component. Some things seem very weird to me. Especially the alternative the startActivityForResult
th...@google.com <th...@google.com>
th...@google.com <th...@google.com> #7
This is now fixed and the fix is going to be included in the next canary version of the Android Studio.
Description
Version used:
implementation 'androidx.navigation:navigation-fragment-ktx:2.2.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.2.2'
But also:
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.0'
Devices/Android versions reproduced on:
Pixel 4 Android R beta 1.5
- Sample project to trigger the issue.
Attached
- A screenrecord or screenshots showing the issue (if UI related).
Attached
The bug is that when I create a new project which uses navigation component, it has labels for the fragments, but those labels don't change the toolbar title, and I don't think there is even an official API for this, sadly.
Please fix it and also let me know how to officially support such a thing for fragments, when a toolbar belongs to the Activity.