The New Jetpack Register for Activity Result API
summary
Android recommends replacing startActivityForResult with registerForActivityResult and custom ActivityResultContract implementations that declare input and output types and override two methods, letting results be delivered as typed data instead of raw intents. Prebuilt contracts handle permissions and photos. Tests inject an ActivityResultRegistry so tests run without launching another activity. Example app migrates code using activity and fragment KTX; migration reduces coupling and makes result handling and testing simpler.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 0:24Meet Madona
- 1:06What is it
- 1:50Why
- 4:07New API
- 4:20Streamfronto
- 5:56Register Contract
- 7:04Overload
- 8:00Summary
- 8:28Questions
related talks
18mRescuing Old Code with JetPack
42mRoad to Single Activity
01h 13mAccelerating Android Development with Google Jetpack
31mWhy Jetpack?
26mRegister - Better In-app-building testings on Android
43mAndroid Jetpack ❤️ Kotlin: On the road to more wholesome APIs
29mWhat's new in Android
42mBuild testable apps for Android
