Version 1.0.0-alpha06
April 3rd, 2019
androidx.activity:activity:1.0.0-alpha06 and androidx.activity:activity-ktx:1.0.0-alpha06 are released. The commits included in this version can be found here.
API changes
- ComponentActivity now contain a second constructor that takes a
@LayoutRes int, which replaces the previous behavior of annotating your AppCompatActivity class with@ContentView. This approach works in both app and library modules. (b/128352521) - The
OnBackPressedCallbackrelated APIs on ComponentActivity have been deprecated in favor of the newOnBackPressedDispatcher, retrievable viagetOnBackPressedDispatcher(). (aosp/922523) - Methods to add a new
OnBackPressedCallbackto theOnBackPressedDispatchernow return aCancellableobject, allowing removal of the callback without requiring an explicit reference to theOnBackPressedDispatcher. (aosp/922523) - Adding a
OnBackPressedCallbackwith an associatedLifecycleOwnernow results in adding and removing theOnBackPressedCallbackas the Lifecycle is started and stopped, respectively. (aosp/922523)
Version 1.0.0-alpha05
March 13th, 2019
androidx.activity:activity:1.0.0-alpha05 and
androidx.activity:activity-ktx:1.0.0-alpha05 are released. The full list of commits
included in this release can be found here.
New features
@ContentViewannotation lookups are now cached (b/123709449)
Version 1.0.0-alpha04
January 30, 2019
androidx.activity:activity 1.0.0-alpha04and androidx.activity:activity-ktx 1.0.0-alpha04 are released.
New features
- Added support for the
@ContentViewclass annotation that allows you to indicate which layout XML file should be inflated as an alternative to usingsetContentView(). (aosp/837619)
API changes
- Added a note that
getViewModelStore()should not be overridden and will be made final in a future release. Please file a feature request if you are currently overriding this method. (aosp/837619)
Bug fixes
- The
activitymodule now depends on version 2.1.0-alpha02 of ViewModel to match theactivity-ktxmodule’s dependency.
Version 1.0.0-alpha03
December 17, 2018
androidx.activity 1.0.0-alpha03 is released.
New features
- ComponentActivity now implements
BundleSavedStateRegistryOwnerand depends on the newly released SavedState library [aosp/815133] - ComponentActivity now works around an Android framework bug that would cause InputMethodManager to leak the last focused view [b/37122102]
Version 1.0.0-alpha02
December 3, 2018
API changes
- Added a note that
getLifecycle()should not be overridden and will be madefinalin a future release. Please file a feature request if you are currently overriding this method. (aosp/815834)
Version 1.0.0-alpha01
November 5, 2018
androidx.activity 1.0.0-alpha01 introduces
ComponentActivity, a new base class of the existing FragmentActivity and
AppCompatActivity.
New features
- You can now register an
OnBackPressedCallbackviaaddOnBackPressedCallbackto receiveonBackPressed()callbacks without needing to override the method in your activity. - Added a new
by viewModels()Kotlin property delegate for retrievingViewModels from aComponentActivity. - Pending input events (such as clicks) are now canceled in
onStop().
API changes
- The implementation of
LifecycleOwnerandViewModelStoreOwnerhave been moved fromFragmentActivitytoComponentActivity. onRetainCustomNonConfigurationInstancehas been deprecated. Use aViewModelfor storing objects that need to survive configuration changes.

