changeset 29:eec88eba58e9

Fix receiving from another app.
author David Barts <n5jrn@me.com>
date Wed, 24 Feb 2021 18:44:47 -0800
parents cf9621e88d2d
children aacf7a856b5f
files app/src/main/java/com/bartsent/simpleresizer/EditImage.kt
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/app/src/main/java/com/bartsent/simpleresizer/EditImage.kt	Wed Feb 24 13:53:39 2021 -0800
+++ b/app/src/main/java/com/bartsent/simpleresizer/EditImage.kt	Wed Feb 24 18:44:47 2021 -0800
@@ -94,8 +94,9 @@
     override fun onResume() {
         super.onResume()
 
+        Log.d("EditImage", "intent action = ${intent?.action ?: "(none)"}")
         // Read the URI, die if we can't.
-        val imageUri = intent?.data
+        val imageUri = intent?.data ?: intent?.extras?.get(Intent.EXTRA_STREAM) as? Uri
         if (imageUri == null) {
             if (State.bitmap == null)
                 showFatalError(getString(R.string.error_no_uri))