Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我不希望用户在我的应用程序运行时移除 SD 卡,因为它将包含我将在我的应用程序中用于显示图像和信息的数据库。
我看到的可能解决方案是在应用程序启动时将 SD 卡中的数据库内容复制到应用程序中(但它可能会消耗时间)。
当 SD 卡被移除时,有什么特别的方法可以冻结我的应用程序吗?
提前感谢您的帮助!
干杯,苏米特
SD卡上没有数据库怎么样?如果要下载,请直接下载到内部存储。如果它作为资产或资源在 APK 中,请将其提取到内部存储中。
如果您需要使用外部存储(SD卡),请在应用启动时检查外部存储是否已挂载。如果不是,则显示适当的消息并完成活动。