第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

Android檔案存在()無(wú)法運(yùn)作

Android檔案存在()無(wú)法運(yùn)作

素胚勾勒不出你 2021-04-07 15:08:06
目前,我目前正在嘗試從中下載文件Uri,但我想這樣做,以便如果文件已下載,將無(wú)法再下載。所以我決定使用file.exists()它來(lái)做,但是現(xiàn)在由于file.exists()某種原因該方法不起作用。Uri uri = Uri.parse("http://kmmc.in/wp-content/uploads/2014/01/lesson2.pdf");Uri path = Uri.parse("file:///storage/emulated/0/Download/");String test = uri.getPath();File file = new File(path.getPath());File check = new File(path.getPath()+uri.getLastPathSegment());if (!check.exists()||!check.isFile()) {  DownloadManager.Request request = new DownloadManager.Request(uri);  request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);  request.setDestinationInExternalPublicDir(String.valueOf(file), uri.getLastPathSegment());  Long reference = downloadManager.enqueue(request);}Intent intent = new Intent(MainActivity.this,ViewActivity.class);intent.putExtra("book",""+uri.getLastPathSegment()+"");startActivity(intent);我嘗試進(jìn)行文件檢查,查看文件是否存在,但是即使文件已經(jīng)下載且位于正確的位置,我也總是得到文件不存在的信息。有人可以幫我弄這個(gè)嗎?
查看完整描述

2 回答

  • 2 回答
  • 0 關(guān)注
  • 170 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)