<kbd id="9plqc"><label id="9plqc"></label></kbd>

        <th id="9plqc"></th>
        1. <center id="9plqc"><video id="9plqc"></video></center>
          <sub id="9plqc"><form id="9plqc"><pre id="9plqc"></pre></form></sub>
          <nav id="9plqc"><form id="9plqc"><legend id="9plqc"></legend></form></nav>
          Android Studio,無法找到項目,下載后打開文件 您所在的位置:網(wǎng)站首頁 屬蛇的跟屬馬的配不配對 Android Studio,無法找到項目,下載后打開文件

          Android Studio,無法找到項目,下載后打開文件

          2023-06-12 07:50| 來源: 網(wǎng)絡(luò)整理| 查看: 265

          在Android Studio中,我收到兩個不同的錯誤,第一個是:"Unable to found item",然后是:"Access denied“。當(dāng)我在下載文件后打開它時,就會發(fā)生這種情況。我有以下權(quán)限:

          正在下載文件,但我無法讀取它們。下面是我的代碼:

          //first error by this way //String PATH = "/data/data/com.myproj.myproj/attafiles/"; //File folder = new File(PATH); // if (!folder.exists()) { // folder.mkdirs(); // } //URL url = new URL(imageURL); //File file = new File(folder , fileName); //Second error URL url = new URL(imageURL); File file = new File(context.getFilesDir(), fileName); URLConnection ucon = url.openConnection(); InputStream is = ucon.getInputStream(); BufferedInputStream bis = new BufferedInputStream(is); ByteArrayBuffer baf = new ByteArrayBuffer(50); int current = 0; while ((current = bis.read()) != -1) { baf.append((byte) current); } FileOutputStream fos = new FileOutputStream(file); fos.write(baf.toByteArray());fos.close(); Uri path = Uri.fromFile(file); String fileExtension= MimeTypeMap.getFileExtensionFromUrl(path.toString()); String mimeType= MimeTypeMap.getSingleton().getMimeTypeFromExtension(fileExtension); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(path, mimeType); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(intent);


          【本文地址】

          公司簡介

          聯(lián)系我們

          今日新聞

          推薦新聞

          專題文章
            CopyRight 2018-2019 實驗室設(shè)備網(wǎng) 版權(quán)所有
            黄色免费网站在线看,韩国精品在线观看,韩国美女一区二区,99国产热 珲春市| 临武县| 乌兰察布市| 祁连县| 昌黎县| 南江县| 金坛市| 甘孜县| 临潭县| 泰宁县| 普兰县| 曲周县| 西青区| 汾阳市| 乐陵市| 浪卡子县| 辛集市| 黔东| 德令哈市| 四川省| 双峰县| 建湖县| 渭源县| 祥云县| 台山市| 隆化县| 长沙市| 永嘉县| 临桂县| 喀喇| 资兴市| 安塞县| 岱山县| 绥阳县| 如东县| 兴仁县| 宝丰县| 汉阴县| 金秀| 大城县| 五台县| http://444 http://444 http://444 http://444 http://444 http://444