gpt4 book ai didi

Android 可以使用 ACTION_SEND 来调用服务

转载 作者:行者123 更新时间:2023-11-29 22:30:37 26 4
gpt4 key购买 nike

我已经成功地能够使用 ACTION_SEND Intent ,当在图库中按下共享按钮时,它会在列表中显示我的应用程序。我的应用程序基本上将所选图片发送到我的计算机,不需要用户进一步输入。而不是在列表中选择时启动我的应用程序,这是一个不必要的步骤,是否可以将数据传递到我自己的发送图片的服务并避免启动我的应用程序?

如果不是,我还有什么其他选择?启动我的应用程序,发送图片并关闭 Activity ?

最佳答案

Rather than starting my app when selected in the list which is an unnecessary step is it possible to pass the data to my own service which sends the picture and avoid starting my app?

ACTION_SEND 用于启动 Activity ,而不是服务 -- 抱歉。

If not what other options do I have? Start my app, sent the picture and close the activity?

听起来很有道理。如果您在 onCreate() 中执行所有这些操作,调用 finish(),并且从不调用 setContentView(),则不会向用户。

关于Android 可以使用 ACTION_SEND 来调用服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4190265/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com