Fixed
Status Update
Comments
il...@google.com <il...@google.com>
il...@google.com <il...@google.com>
il...@google.com <il...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit b4a3fe1d53c8c8082cf16795da164c446f7fd912
Author: Ian Lake <ilake@google.com>
Date: Wed Jul 15 14:34:08 2020
Add a hook that fires before the Activity's super.onCreate()
Provide a standard, composable API for libraries and
developers to run code as soon as possible after a
Context is available to an Activity (i.e., before the
logic in the base Activity.onCreate() runs and before any
layout is inflated).
This updates the code in FragmentActivity and
AppCompatActivity to use that new API.
Test: new activity tests pass
Test: existing fragment and appcompat tests still pass
BUG: 161390636
Relnote: "`ComponentActivity` now implements
`ContextAware`, allowing you to add one or more
`OnContextAvailableListener` instances which will
receive a callback before the base `Activity.onCreate()`."
Change-Id: I513da73bc0862b62af4166be35ba353fc7869a09
M activity/activity/api/1.2.0-alpha07.txt
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_1.2.0-alpha07.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_1.2.0-alpha07.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/androidTest/java/androidx/activity/ComponentActivityLifecycleTest.kt
A activity/activity/src/androidTest/java/androidx/activity/contextaware/ContextAwareHelperTest.kt
M activity/activity/src/main/java/androidx/activity/ComponentActivity.java
A activity/activity/src/main/java/androidx/activity/contextaware/ContextAware.java
A activity/activity/src/main/java/androidx/activity/contextaware/ContextAwareHelper.java
A activity/activity/src/main/java/androidx/activity/contextaware/OnContextAvailableListener.java
M appcompat/appcompat/build.gradle
M appcompat/appcompat/src/main/java/androidx/appcompat/app/AppCompatActivity.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentActivity.java
https://android-review.googlesource.com/1364176
Branch: androidx-master-dev
commit b4a3fe1d53c8c8082cf16795da164c446f7fd912
Author: Ian Lake <ilake@google.com>
Date: Wed Jul 15 14:34:08 2020
Add a hook that fires before the Activity's super.onCreate()
Provide a standard, composable API for libraries and
developers to run code as soon as possible after a
Context is available to an Activity (i.e., before the
logic in the base Activity.onCreate() runs and before any
layout is inflated).
This updates the code in FragmentActivity and
AppCompatActivity to use that new API.
Test: new activity tests pass
Test: existing fragment and appcompat tests still pass
BUG: 161390636
Relnote: "`ComponentActivity` now implements
`ContextAware`, allowing you to add one or more
`OnContextAvailableListener` instances which will
receive a callback before the base `Activity.onCreate()`."
Change-Id: I513da73bc0862b62af4166be35ba353fc7869a09
M activity/activity/api/1.2.0-alpha07.txt
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_1.2.0-alpha07.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_1.2.0-alpha07.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/androidTest/java/androidx/activity/ComponentActivityLifecycleTest.kt
A activity/activity/src/androidTest/java/androidx/activity/contextaware/ContextAwareHelperTest.kt
M activity/activity/src/main/java/androidx/activity/ComponentActivity.java
A activity/activity/src/main/java/androidx/activity/contextaware/ContextAware.java
A activity/activity/src/main/java/androidx/activity/contextaware/ContextAwareHelper.java
A activity/activity/src/main/java/androidx/activity/contextaware/OnContextAvailableListener.java
M appcompat/appcompat/build.gradle
M appcompat/appcompat/src/main/java/androidx/appcompat/app/AppCompatActivity.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentActivity.java
ma...@gmail.com <ma...@gmail.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 494d98d48e3c95c4338bda7ed1bf46797de257f6
Author: Ian Lake <ilake@google.com>
Date: Mon Aug 03 13:07:36 2020
Deliver the Context when added after it is available
Previously, an OnContextAvailableListener would only
receive a callback if added prior to the Context
being made available.
Rather than allow developers fall into a pitfall
where they add a listener and never receive a
callback, synchronously deliver the currently
available Context to listeners.
Test: updated activity tests pass
BUG: 161390636
Relnote: N/A
Change-Id: I24eff02712c90e84e1998407082e0b07cf04b44a
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/androidTest/java/androidx/activity/contextaware/ContextAwareHelperTest.kt
M activity/activity/src/main/java/androidx/activity/ComponentActivity.java
M activity/activity/src/main/java/androidx/activity/contextaware/ContextAware.java
M activity/activity/src/main/java/androidx/activity/contextaware/ContextAwareHelper.java
https://android-review.googlesource.com/1386006
Branch: androidx-master-dev
commit 494d98d48e3c95c4338bda7ed1bf46797de257f6
Author: Ian Lake <ilake@google.com>
Date: Mon Aug 03 13:07:36 2020
Deliver the Context when added after it is available
Previously, an OnContextAvailableListener would only
receive a callback if added prior to the Context
being made available.
Rather than allow developers fall into a pitfall
where they add a listener and never receive a
callback, synchronously deliver the currently
available Context to listeners.
Test: updated activity tests pass
BUG: 161390636
Relnote: N/A
Change-Id: I24eff02712c90e84e1998407082e0b07cf04b44a
M activity/activity/api/current.txt
M activity/activity/api/public_plus_experimental_current.txt
M activity/activity/api/restricted_current.txt
M activity/activity/src/androidTest/java/androidx/activity/contextaware/ContextAwareHelperTest.kt
M activity/activity/src/main/java/androidx/activity/ComponentActivity.java
M activity/activity/src/main/java/androidx/activity/contextaware/ContextAware.java
M activity/activity/src/main/java/androidx/activity/contextaware/ContextAwareHelper.java
Description
Version used: 1.0.0-alpha09
Devices/Android versions reproduced on: Nexus 5X
Sample: attached
Screen recording: attached
As you can see in the attached sample, I have a simple application with one Activity that has a NavHostFragment and a BottomNavigationView. The navigation graph contains 3 fragment destinations(fragments A, B and C) which are also the menu items for the BottomNavigationView. Fragment C has a drawer layout that contains another NavHostFragment and a NavigationView. This inner NavHostFragment has its own navigation graph with another 3 fragments: D(start destination), E, and F.
Steps to reproduce:
1) Open app
2) Open Fragment C which implicitly opens Fragment D(start destination for that NavHostFragment)
3) From the drawer open Fragment E
4) Click on Fragment B from BottomNavigationView
5) Press back
Observe that Fragment D is opened and that the Fragment B is still the selected item from the BottomNavigationView.
My expected behavior is that the inner NavHostFragment stack is cleared by step 4 and the back button will navigate the user to the start destination of the outer NavHostFragment(Fragment A).
Strange behavior can also be observed if you click on A or C destinations at step 4.
I'm looking forward to your reply.
Thanks!