private String getExternalStoragePath() { String value = ""; try { if (!Environment.isExternalStorageEmulated() && Environment.isExternalStorageRemovable() && Environment.getExternalStorageDirectory().canWrite()) { value = Environment.getExternalStorageDirectory().getPath(); } else { final String[] sdPathArray = {"/storage/extSdCard", "/storage/sdcard1", "/mnt/sdcard2", "/mnt/sdcard-ext", "/mnt/ext_sdcard", "/mnt/sdcard/SD_CARD", "/mnt/sdcard/extra_sd", "/mnt/extrasd_bind", "/mnt/sdcard/ext_sd", "/mnt/sdcard/external_SD"}; for (String path : sdPathArray) { File file = new File(path); if (file.isDirectory() && file.canRead() && file.canWrite()) { value = path; break; } } } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return value; }
名稱欄目:調(diào)用Android系統(tǒng)接口獲取不到TF卡路徑時
文章鏈接:http://aaarwkj.com/article48/igdiep.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站營銷、云服務(wù)器、網(wǎng)站維護、網(wǎng)站制作、面包屑導(dǎo)航、定制網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)