to potentially provide a result in lieu of starting an activity.“
假设我想请求permissions.Generally,我必须通过ActivityResultLauncher(契约,回调)声明一个ActivityResultLauncher,在回调中编写工作逻辑,并在正确的时间启动它。据我所知,使用SynchronousResult(),我不必注册ActivityResultLauncher。我只需要声明一个ActivityResultContract,调
在 of androidx.activity:activity-ktx中,不能再使用Activity.registerForActivityResult()创建请求了,就像上面在“行为更改”下突出显示的那样,在中也可以看到。例如,在活动的onCreate函数之外实例化后,可以通过传递一个类来注册活动结果,然后在Composable中启动请求。但是,不能以这种方式注册要在完成后执行的回调。