从仅充电更改为磁盘驱动器后 UI 崩溃?
似乎应用程序(或者可能只是我的应用程序)具有以下所需权限:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
偶尔往往会导致 UI 崩溃,例如,当您正在运行该应用程序,然后决定从“仅限充电”切换时到磁盘驱动器。另一件事是,当用户处于磁盘驱动器模式时,该应用程序对用户不可用。您收到消息:“您的手机上不再安装链接的程序”。
有没有办法以编程方式缓解这个问题。也许,通过检查用户何时处于磁盘驱动器模式,这应该触发删除权限或类似的操作。这可能吗?
It seems that apps, or maybe it's just my app, that have the following required permissions:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
tend to occasionally crash the UI when for example you're running the app and then you decide to switch from Charge Only to Disk Drive. The other thing is that the app becomes unavailable to the user when the user is on Disk Drive mode. You get the message : "The Linked program is no longer installed on your phone".
Is there a way to mitigate this issue, programmatically. Maybe, by checking when the user is on Disk Drive mode which should trigger the removal of the permissions or something similar. Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否使用光标适配器/内容提供程序组合?当外部存储被卸载/安装时,您应该能够获得广播,并且您可以编写一些后备代码。您是否将应用程序安装在 SDCARD 上?
http://android-developers.blogspot。 com/2010/07/apps-on-sd-card-details.html
SD卡就绪的 Android Intent
看看这些链接是否有帮助。
Are you using a cursor adapter/content provider combination? You should be able to get broadcasts when the external storage is unmounted/mounted, and you could write some fall-back code. Are you installing your app on SDCARD?
http://android-developers.blogspot.com/2010/07/apps-on-sd-card-details.html
android intent for sdcard ready
See if these links help.