Java 如何通过打开图像来启动myapp?
我正在开发一个图像编辑器应用程序,当用户单击文件管理器中的图像或...时,我希望我的应用程序位于“打开方式...”列表中(就像“照片编辑器”应用程序所做的那样) ) :
问题是我不知道怎么做这样的事。
我在 youtube 上进行了研究,发现它与 Manifest.xml
文件中的 intent filter
有关。
我已经尝试随机添加一些
到我的意图过滤器中,但没有成功。
I'm working on an image editor app and I want to have my app being in the 'Open With ...' list when the user clicks on an image from file manager or ... (Like how 'Photo Editor' app did) :
Click to see the example (Edited)
And the problem is that I don't know how to do such a thing.
I have researched in youtube and I found that it's about the intent filter
in the Manifest.xml
file.
I already tried adding some <action/>
to my intent filter by random but it didn't worked.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
转到
Manifest
文件并搜索您的LAUNCHER
活动,例如像这样的
SplashActivity
并在您的 SplashActivity 中获取该数据执行此操作:您可以将该图像发送到下一个活动,通过执行此操作,
您可以将 URI 存储为字符串
,然后将字符串转换回 URI,如下所示(EditorActivity)
Go to the
Manifest
file and search for yourLAUNCHER
activity for exampleSplashActivity
like this
And To get that data in your SplashActivity do this :
And you can send that image to the next activity by doing this
you can store the URI as a string
and then just convert the string back to URI like this in your (EditorActivity)