Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

startIntentSenderLauncher.launch(intentSender) 使用方法 #8

Closed
luowenyue opened this issue Apr 1, 2022 · 2 comments
Closed

startIntentSenderLauncher.launch(intentSender) 使用方法 #8

luowenyue opened this issue Apr 1, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@luowenyue
Copy link

文档中使用方法如下:

val startIntentSenderLauncher = startIntentSenderLauncher {
  if (it.resultCode == Result_OK) {
    // 处理结果
  }
}

startIntentSenderLauncher.launch(intentSender) 

但实际写startIntentSenderLauncher.launch(intentSender) 报错,
Not enough information to infer type variable T
因为这个launch方法是这样的:launch<T:Activity>(intentSender)
很让人疑惑,请指教

@DylanCaiCoding
Copy link
Owner

感谢反馈,泛型是写多了,我迟点改一下。先不要用这个扩展,改回原本 ActivityResult API 的 launch 用法。

startIntentSenderLauncher.launch(IntentSenderRequest.Builder(intentSender).builder())

@DylanCaiCoding DylanCaiCoding added the bug Something isn't working label Apr 1, 2022
@DylanCaiCoding
Copy link
Owner

抱歉,因为 ActivityResult 和时间日期的用法改动较大,之前又比较忙,所以新版拖得比较久。目前已经在 1.1.0 修复了该问题,原有的 xxxxLauncher 函数名将改成了 registerForXXXXResult,这样和官方 API 的用法更加一致。

更新日志:https://github.com/DylanCaiCoding/Longan/releases/tag/1.1.0
ActivityResult 文档:https://dylancaicoding.github.io/Longan/#/usage/activityresult

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants