/**
     * 检测是否安装外置SD卡
     *
     * @return
     */
    public boolean checkSDcard() {
        StorageList list = new StorageList(this);
        if (list.getVolumePaths()[0].equals(Environment.MEDIA_MOUNTED)) {
            return true;
        } else {
            return false;
        }
    }

安装了外置SD卡,则返回为true,没有安装SD卡返回值为false。

posted on 2018-12-26 13:21  龙从一  阅读(737)  评论(0编辑  收藏  举报