将活动叠加在通过意图打开的其他活动上

发布于 2024-10-17 03:20:15 字数 197 浏览 3 评论 0原文

每当在图库中查看照片时,我都会尝试在照片上覆盖一个小标题框。

我找不到任何查看画廊应用程序广播的照片的意图,我可以在其中连接广播接收器来绘制盒子。

因此,我使用 Intent.GET_CONTENT 从图库中获取照片,并使用 Intent.VIEW 来显示它。是否可以在我通过 Intent.VIEW 打开的图库应用程序的活动上覆盖半透明的标题框?

I'm trying to overlay a small caption box over a photo whenever it is viewed in the gallery.

I couldn't find any intents for VIEWING A PHOTO that is broadcast by the gallery app, into which I could hook a broadcast receiver to draw the box.

So I'm using Intent.GET_CONTENT to get a photo from gallery and Intent.VIEW to display it. Is it possible to overlay a semi transparent caption box over the gallery app's activity that I opened via Intent.VIEW?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

叹沉浮 2024-10-24 03:20:15

每当在图库中查看照片时,我都会尝试在照片上覆盖一个小标题框。

这是不可能的。首先,Android 操作系统中没有“图库”应用程序。通常会有一个应用程序让您通过 GET_CONTENT 获取照片并通过 VIEW 查看图像,但无论它们是否与您认为的内容有任何相似之处, “画廊”是不确定的。

我找不到任何查看图库应用程序广播的照片的意图,我可以在其中连接广播接收器来绘制方框。

同样,这会因应用程序而异,但我真的很怀疑是否提供此类广播。

是否可以在我通过 Intent.VIEW 打开的图库应用程序的活动上覆盖半透明的标题框?

不可靠,因为您无法知道 VIEW 活动何时出现在屏幕上,以及用户在其他活动中是否点击了某些内容(例如,HOME)。您将可以更好地在自己的活动中亲自查看图像,您还可以在其中显示“半透明标题框”。

I'm trying to overlay a small caption box over a photo whenever it is viewed in the gallery.

This is not possible. For starters, there is no "gallery" application in the Android OS. There typically will be an application to let you get a photo via GET_CONTENT and view an image via VIEW, but whether or not they bear any resemblance to what you think of as a "gallery" is indeterminate.

I couldn't find any intents for VIEWING A PHOTO that is broadcast by the gallery app, into which I could hook a broadcast receiver to draw the box.

Again, this will vary by app, but I really rather doubt any supply such broadcasts.

Is it possible to overlay a semi transparent caption box over the gallery app's activity that I opened via Intent.VIEW?

Not reliably, because you have no way of knowing when the VIEW activity is on-screen and whether the user has tapped something (e.g., HOME) when in that other activity. You will be better served viewing the image yourself in your own activity, where you can also display your "semi transparent caption box".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文