4

有什么办法可以强制 AppWidget 工作,即使 App 被移动到 SD 卡并且 SD 卡没有unmounted文档说:

...如果应用程序使用以下任何功能,则不应允许将应用程序安装在外部存储设备上,因为卸载外部存储设备时会出现以下后果:
...
App Widgets
您的 App Widgets 将从主屏幕。当外部存储重新挂载时,您的 App Widget 将无法供用户选择,直到系统重置主应用程序(通常直到系统重新启动)。

似乎文档说 AppWidget 将从主屏幕中删除,if用户卸载 SD 卡。但是当我将模拟器中的应用程序移动到 SD 卡(并且我没有卸载 SD 卡)problem loading widget时,在主屏幕中看到消息,小部件也不可用对于小部件列表中的用户。为什么?

4

1 回答 1

5

For now, there is no way to make a Widget to work while the app is installed on the SD-Card. This is the normal behavior even when SD-Card is mounted.

You get the error problem loading widget because Widgets are automatically disabled (and removed from the Widget list, so you can't add them) when you move the app to external storage, but they are kept in Home Screen, to be ready when you move it back to the phone and home application is resetted.

If you're going to support that the user move your app to external storage, maybe you can publish another app to only hold your widgets, and configure it so that it can only by installed in the phone. This solves the problem but the user has to download two apps instead of one.

于 2013-09-06T16:54:16.140 回答