use file provider on android M as well
This commit is contained in:
parent
8c1bb058da
commit
a4020e85f6
|
@ -440,7 +440,7 @@ public class FileBackend {
|
|||
public Uri getTakePhotoUri() {
|
||||
File file = new File(getTakePhotoPath()+"IMG_" + this.IMAGE_DATE_FORMAT.format(new Date()) + ".jpg");
|
||||
file.getParentFile().mkdirs();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
return FileProvider.getUriForFile(mXmppConnectionService, CONVERSATIONS_FILE_PROVIDER, file);
|
||||
} else {
|
||||
return Uri.fromFile(file);
|
||||
|
|
|
@ -703,7 +703,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
|
|||
mime = "*/*";
|
||||
}
|
||||
Uri uri;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
try {
|
||||
uri = FileProvider.getUriForFile(activity, FileBackend.CONVERSATIONS_FILE_PROVIDER, file);
|
||||
} catch (IllegalArgumentException e) {
|
||||
|
|
Loading…
Reference in a new issue