其他分享
首页 > 其他分享> > Android;强制AppWidget从SD卡工作?

Android;强制AppWidget从SD卡工作?

作者:互联网

有没有办法迫使AppWidget工作,甚至App被移动到SD卡并且SD卡没有卸载? Docs说:

… you should not allow your application to be installed on the external storage if it uses any of the following features, due to the cited consequences when the external storage is unmounted:

App Widgets
Your App Widget will be removed from the home
screen. When external storage is remounted, your App Widget will not
be available for the user to select until the system resets the home
application (usually not until a system reboot).

似乎文档说如果用户卸载SD卡,AppWidget将从主屏幕上删除.但是当我将模拟器中的App移动到SD卡(我没有卸载SD卡)时,在主屏幕中看到问题加载小部件消息,窗口小部件列表中的用户无法使用窗口小部件.为什么?

解决方法:

目前,当应用程序安装在SD卡上时,无法使Widget工作.即使安装了SD卡,这也是正常现象.

您收到错误问题加载窗口小部件,因为当您将应用程序移动到外部存储时,窗口小部件会自动禁用(并从窗口小部件列表中删除,因此您无法添加它们),但它们会保留在主屏幕中,以便在您准备好时将其移回手机并重置家庭应用程序.

如果您支持用户将您的应用程序移动到外部存储,也许您可​​以发布另一个应用程序来仅保存您的小部件,并对其进行配置,使其只能安装在手机中.这解决了问题,但用户必须下载两个应用程序而不是一个.

标签:android-appwidget,android,android-sdcard
来源: https://codeday.me/bug/20190831/1776865.html