有没有一种方法,如果SD卡安装VS没装上,告诉? [英] Is there a way to tell if the sdcard is mounted vs not installed at all?

查看:178
本文介绍了有没有一种方法,如果SD卡安装VS没装上,告诉?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 API逻辑你可以,如果检测SD卡可用于读取或写入,但它不会告诉你它为什么不写。

Using the api logic you can detect if the sd card is available for read or write, but it doesn't tell you why it is not writable.

我想知道,如果用户甚至有一个SD卡VS如果它只是安装。

I want to know if the user even has a sd card vs if it just mounted.

这可能吗?

推荐答案

例如:

String state = Environment.getExternalStorageState();

if (state.equals(Environment.MEDIA_MOUNTED_READ_ONLY)) {

}

检查出可能的常数为:<一href="http://developer.android.com/reference/android/os/Environment.html#getExternalStorageState%28%29">http://developer.android.com/reference/android/os/Environment.html#getExternalStorageState%28%29

这篇关于有没有一种方法,如果SD卡安装VS没装上,告诉?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆