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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

uri 那部分在安卓7以后有權(quán)限風(fēng)險(xiǎn),不能通過(guò)。用fileprovider 后,相機(jī)2拍照后顯示圖片報(bào)錯(cuò)找不到文件或文件夾W/System.err: java.io.FileNotFoundException: /storage/emulated/0/temp.jpg: open failed: ENOENT (No such file or directory)

????public?void?startCamera2(View?view){
????????Intent?intent=new?Intent(MediaStore.ACTION_IMAGE_CAPTURE);
//????????Uri?photoUri?=?Uri.fromFile(new?File(mFilePath));//顯示的路徑有權(quán)限風(fēng)險(xiǎn)
????????photoUri?=?FileProvider.getUriForFile(
????????????????this,
????????????????getPackageName()?+?".provider",
????????????????new?File(mFilePath));
????????intent.putExtra(MediaStore.EXTRA_OUTPUT,photoUri);?//更改照片存儲(chǔ)路徑到photoUri
????????startActivityForResult(intent,REQ_2);???//打開(kāi)相機(jī)拍照,返回相機(jī)結(jié)果(照片)并回到原界面
????}
????//onActivityResult部分代碼
????else?if(requestCode?==?REQ_2){
????????????????FileInputStream?fis?=?null;
????????????????try?{
????????????????????fis?=?new?FileInputStream(new?File(mFilePath));
????????????????????Bitmap?bitmap?=?BitmapFactory.decodeStream(fis);??//涉及寫(xiě)入內(nèi)存卡權(quán)限,在manifest里面配置

//????????????????????Bitmap?bitmap?=?BitmapFactory.decodeStream(getContentResolver().openInputStream(photoUri));
????????????????????mImageView.setImageBitmap(bitmap);???????????//從內(nèi)存讀取原圖


正在回答

1 回答

是手機(jī)系統(tǒng)版本的問(wèn)題,手機(jī)舊的不行

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

uri 那部分在安卓7以后有權(quán)限風(fēng)險(xiǎn),不能通過(guò)。用fileprovider 后,相機(jī)2拍照后顯示圖片報(bào)錯(cuò)找不到文件或文件夾W/System.err: java.io.FileNotFoundException: /storage/emulated/0/temp.jpg: open failed: ENOENT (No such file or directory)

我要回答 關(guān)注問(wèn)題
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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