Android 7.0以上版本在OnCreate中添加:
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build());
builder.detectFileUriExposure()
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build());
builder.detectFileUriExposure()
2018-08-16
安卓7以后不能用這種file:///去訪問絕對路徑了好像。現(xiàn)在安卓8.1真機上運行這個是運行不了的。可以用FileProvider產(chǎn)生URI去訪問本地文件。
2018-06-16
// if(requestCode==RESULT_OK){ 去掉就可以顯示圖片了。因為RESULT_OK值為-1
2018-02-02
<intent-filter>
<action android:name="android.media.action.IMAGE_CAPTURE"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
在配置文件中添加這些代碼,就可以跟系統(tǒng)相機一樣可以被其它程序調(diào)用。
<action android:name="android.media.action.IMAGE_CAPTURE"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
在配置文件中添加這些代碼,就可以跟系統(tǒng)相機一樣可以被其它程序調(diào)用。
2017-12-15
在真機上運行的時候,可能要去應(yīng)用設(shè)置那里給app手動授權(quán)文件讀取
2017-11-19