[英]Android 9.0 - How to find if user has inserted a corrupted sd card?
Environment.getExternalStorageState().equalsIgnoreCase(Environment.MEDIA_MOUNTED_READ_ONLY)//corrupted -sd card
But whenever I insert a corrupted sd card, the status is always "mounted", is this approach wrong?但是每当我插入损坏的 sd 卡时,状态总是“已安装”,这种方法是错误的吗?
I solved it by finding whether the inserted card is read-only or not, by traversing the /proc/mounts file and checking whether read_options of sdcard's mounted_directory is read-only or read-write.我通过遍历/proc/mounts文件并检查sdcard的mounted_directory的read_options是只读还是读写来解决这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.