通过 startActivityForResult 处理方式 google已经不再推荐,希望能支持新的ActivityResultLauncher来开启扫描界面
jyh149129 opened this issue · comments
如题
您好,方便留个微信吗,我们可以线下沟通
或者您也可以添加我们技术人员的微信:a2743979839
遇到同样的问题,请问如何解决?
private val launcher =
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
if (it.resultCode == Activity.RESULT_OK) {
when (val obj: Parcelable? = it.data?.getParcelableExtra(ScanUtil.RESULT)) {
is HmsScan -> {
}
}
}
}
launcher. Launch(
Intent(
requireContext(),
ScanKitActivity::class.java
).putExtra(
"ScanFormatValue",
HmsScanAnalyzerOptions.Creator().setHmsScanTypes(HmsScan.ALL_SCAN_TYPE)
.create().mode
)
)
谢谢