- IntentSenderRequest.Builder.setFlags() allows setting multiple Intent flags rather than only a single flag
- ComponentActivity now provides a FullyDrawnReporter instance that lets multiple components report when they are ready for interaction, and calls reportFullyDrawn() on their behalf once all have completed
- ReportDrawn, ReportDrawnWhen, and ReportDrawnAfter Activity Compose APIs were added to report fully drawn state from individual composables
- The Photo Picker activity contracts PickVisualMedia and PickMultipleVisualMedia now use an additional fallback action when MediaStore.ACTION_PICK_IMAGES is unavailable, allowing OEMs and system apps to provide the Photo Picker experience, before falling back to Intent.ACTION_OPEN_DOCUMENT
- ComponentDialog now implements SavedStateRegistryOwner, has its own SavedStateRegistry, and sets the SavedStateRegistryOwner on its ViewTree, enabling Jetpack Compose within a ComponentDialog
- Several Activity classes were converted to Kotlin while retaining binary compatibility; ActivityResultRegistryOwner and OnBackPressedDispatcherOwner have source-incompatible changes for Kotlin callers, with getters replaced by properties signature changed · inferred, marked in the notes below
- Activity now depends on Lifecycle 2.6.1
- Activity now depends on ProfileInstaller 1.3.0
1 change to check, marked in the notes below
From AndroidX Activity
Important changes since 1.6.0 The Photo Picker activity contracts in PickVisualMedia and PickMultipleVisualMedia have been updated to contain an additional fallback for when MediaStore.ACTION_PICK_IMAGES is unavailable that allows OEMs and system apps, such as Google Play services, to provide a consistent Photo Picker experience on a wider range of Android devices and API levels by implementing the fallback action. The Photo Picker will use this fallback if it is available before falling back to using Intent.ACTION_OPEN_DOCUMENT, which remains to support all API 19 and higher devices. ComponentDialog now implements SavedStateRegistryOwner and has access to its own SavedStateRegistry and sets the SavedStateRegistryOwner for its ViewTree. It is now possible to use Jetpack Compose within a ComponentDialog as it meets both the LifecycleOwner and SavedStateRegistryOwner attached to the Window via the ViewTree APIs requirements. IntentSenderRequest.Builder.setFlags() now allows you to set multiple flags from Intent, rather than only a single flag. Kotlin Conversion A number of Activity classes have been converted to Kotlin. All converted classes still retain their binary compatibility with previous versions. The following classes have source incompatible changes for classes written in Kotlin: ActivityResultRegistryOwner, OnBackPressedDispatcherOwner. The table below provides the source conversions for the new version of Activity: Activity 1.5 Activity 1.6 override fun getActivityResultRegistry() = activityResultRegistry override val activityResultRegistry = activityResultRegistry override fun getOnBackPressedDispatcher() = onBackPressedDispatcher override val onBackPressedDispatcher = onBackPressedDispatcher These classes were also converted to Kotlin, but remain source compatible: ContextAware, ContextAwareHelper, OnContextAvailableListener, IntentSenderRequest, and OnBackPressedDispatcher FullyDrawnReporter APIs ComponentActivity now provides a FullyDrawnReporter instance that allows multiple components to report when they are ready for interaction. ComponentActivity will wait for all components to complete before calling reportFullyDrawn() on your behalf. These APIs take care of the timing requirements for you and do not need to be called as part of an onDraw call. These APIs are encouraged to enable: Signaling the Android Runtime when startup completes, to ensure all of the code run during a multi-frame startup sequence is included and prioritized for background compilation. Signaling Macrobenchmark and Play Vitals when your application should be considered fully drawn for startup metrics, so you can track performance. Three Activity Compose APIs have been added to make it more convenient to use the FullyDrawnReporter from individual composables: ReportDrawn indicates that your composable is immediately ready for interaction. ReportDrawnWhen takes a predicate (i.e., list.count > 0) to indicate when your composable is ready for interaction. ReportDrawnAfter takes a suspending method that, when it completes, indicates that you are ready for interaction. Dependency Updates Activity now depends on Lifecycle 2.6.1. ( 8fc31d) Activity now depends on ProfileInstaller 1.3.0. ( 83d3b1) signature changed · inferred