小部件没有出现在小部件中,因为它应该是

发布于 2025-01-01 08:13:41 字数 285 浏览 4 评论 0原文

我开发了一个 Android 应用程序,它也有一个小部件。问题是,当我将应用程序安装到我的设备时,小部件在小部件选项卡中不可见,因为它应该是(我使用的是 android 4.0.3)。小部件在模拟器中运行良好。但是,如果我将应用程序重新安装到我的设备上,小部件就可用。谁能解释这种奇怪的行为?有什么疯狂的猜测吗?

代码可以在这里找到: Widget 有一个奇怪的行为

I have developed an android app that has a widget as well. The problem is that when i install the app to my device, the widget is not visible in the widget tab as it should be (I am using android 4.0.3). Widget works fine in the emulator. However if i reinstall the app to my device, widget is available. Can anyone explain this strange behaviour? Any wild guesses?

The code could be found here : Widget has a weird bahaviour

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

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

发布评论

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

评论(3

姜生凉生 2025-01-08 08:13:41

AFAICT,您需要有一个活动,并且用户必须启动该活动,然后系统才能识别您的 元素。这似乎是 Android 3.1 中引入的“在手动启动应用程序之前,BroadcastReceiver 无法工作”这一较大变更的产物。

AFAICT, you need to have an activity, and the user must launch that activity before your <receiver> element will be recognized by the system. This appears to be an outgrowth of the larger "no BroadcastReceiver will work until the app is manually launched" change introduced in Android 3.1.

风筝在阴天搁浅。 2025-01-08 08:13:41

当您的应用程序安装在 SD 卡中时,就会发生这种情况。在这种情况下,您不会在小部件列表中看到您的应用程序。您必须转到“设置”->“应用程序”->“your_app”,然后将其移动到手机(内部存储器)中。现在您可以在小部件列表中看到该小部件。

干杯!
恰纳卡

This is happened when your application is installed in the SD card. In that case, you don't see your application in the widget list. You have to go to settings->apps->your_app and then move that into the phone (internal memory). Now you can see the widget in your widget list.

Cheers !!!
Chanaka

非要怀念 2025-01-08 08:13:41

据我所知,这是一个错误

@CommonsWare 描述的“运行一个活动来显示”对于 Honeycomb 来说是一个很好的“解决方法”,但它不适用于 ICS。

我发现在 ICS 中解决这个问题的唯一方法是转到“设置”>应用程序>启动器并“停止”它。

或者您可以重新启动手机。

AFAIK, this is a bug.

The "run an activity for it to show" described by @CommonsWare was a nice "Workaround" for Honeycomb, but it does not work on ICS.

The only way I found to work around it in ICS is to go to settings > apps > Launcher and "stop" it.

Alternatively you could reboot your phone.

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