主屏幕 - 微小的信息消息

发布于 2024-10-06 20:57:14 字数 231 浏览 0 评论 0原文

在我的 HTC Desire (Froyo) 上,我使用电源控制小部件来启用 Wi-Fi。 当我按下 Wi-Fi 按钮时,主屏幕底部会出现一条消息“打开 Wi-Fi”(位于灰色小方框内)(并在 2-3 秒后淡出)。 我查看了“设置”包(platform/packages/apps/Settings.git),但除了“首选项”视图之外,没有发现该特定字符串的任何用法。

有谁知道此消息如何显示以及此机制是否可用于第 3 方应用程序?

On my HTC Desire (Froyo) I use Power Control Widget to enable Wi-Fi.
When I press Wi-Fi button a message "Turn on Wi-Fi" (inside gray tiny box) appears at bottom of home screen (and fades out after 2-3 seconds).
I looked through Settings package (platform/packages/apps/Settings.git), but haven't found any usage of that specific string other that within Preferences view.

Does anyone have any idea what how this message is displayed and if this mechanism is available for 3rd party app?

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

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

发布评论

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

评论(2

瀞厅☆埖开 2024-10-13 20:57:14

这就是所谓的吐司。

您可以在任何活动中调用它。

Toast.makeText(CurrentClassName.this,"The message you would like to display",Toast.LENGTH_SHORT).show();

您可以根据需要将 Toast.LENGTH_LONG 替换为 Toast.LENGTH_SHORT。

It's called a Toast.

You can invoke it in any activty.

Toast.makeText(CurrentClassName.this,"The message you would like to display",Toast.LENGTH_SHORT).show();

You can substitute Toast.LENGTH_SHORT for Toast.LENGTH_LONG depending on what you want.

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