use the default file mimetype at sharing a file

This commit is contained in:
tibbi 2017-03-23 18:26:05 +01:00
parent eb2ff336ce
commit 71051fe928
2 changed files with 2 additions and 2 deletions

View file

@ -32,7 +32,7 @@ android {
} }
dependencies { dependencies {
compile 'com.simplemobiletools:commons:2.13.7' compile 'com.simplemobiletools:commons:2.14.1'
compile 'com.theartofdev.edmodo:android-image-cropper:2.3.1' compile 'com.theartofdev.edmodo:android-image-cropper:2.3.1'
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
compile 'com.google.code.gson:gson:2.8.0' compile 'com.google.code.gson:gson:2.8.0'

View file

@ -85,7 +85,7 @@ fun Activity.openWith(file: File, forceChooser: Boolean = true) {
val uri = Uri.fromFile(file) val uri = Uri.fromFile(file)
Intent().apply { Intent().apply {
action = Intent.ACTION_VIEW action = Intent.ACTION_VIEW
setDataAndType(uri, file.getMimeType("image/jpeg")) setDataAndType(uri, file.getMimeType())
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
val chooser = Intent.createChooser(this, getString(R.string.open_with)) val chooser = Intent.createChooser(this, getString(R.string.open_with))