mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
fix the pick_media intent sent from third party apps
This commit is contained in:
parent
4d515b2b71
commit
092ea401b3
1 changed files with 2 additions and 1 deletions
|
@ -5,6 +5,7 @@ import android.app.Activity
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.content.res.Configuration
|
import android.content.res.Configuration
|
||||||
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.provider.MediaStore
|
import android.provider.MediaStore
|
||||||
import android.support.v4.app.ActivityCompat
|
import android.support.v4.app.ActivityCompat
|
||||||
|
@ -274,7 +275,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
||||||
if (requestCode == PICK_MEDIA && resultData != null) {
|
if (requestCode == PICK_MEDIA && resultData != null) {
|
||||||
Intent().apply {
|
Intent().apply {
|
||||||
val path = resultData.data.path
|
val path = resultData.data.path
|
||||||
val uri = getFileUri(File(path))
|
val uri = Uri.fromFile(File(path))
|
||||||
if (mIsGetImageContentIntent || mIsGetVideoContentIntent || mIsGetAnyContentIntent) {
|
if (mIsGetImageContentIntent || mIsGetVideoContentIntent || mIsGetAnyContentIntent) {
|
||||||
val type = File(path).getMimeType("image/jpeg")
|
val type = File(path).getMimeType("image/jpeg")
|
||||||
setDataAndTypeAndNormalize(uri, type)
|
setDataAndTypeAndNormalize(uri, type)
|
||||||
|
|
Loading…
Reference in a new issue