<small id='Rolcb'></small><noframes id='Rolcb'>

      <legend id='Rolcb'><style id='Rolcb'><dir id='Rolcb'><q id='Rolcb'></q></dir></style></legend>
        <tfoot id='Rolcb'></tfoot>
          <bdo id='Rolcb'></bdo><ul id='Rolcb'></ul>

      1. <i id='Rolcb'><tr id='Rolcb'><dt id='Rolcb'><q id='Rolcb'><span id='Rolcb'><b id='Rolcb'><form id='Rolcb'><ins id='Rolcb'></ins><ul id='Rolcb'></ul><sub id='Rolcb'></sub></form><legend id='Rolcb'></legend><bdo id='Rolcb'><pre id='Rolcb'><center id='Rolcb'></center></pre></bdo></b><th id='Rolcb'></th></span></q></dt></tr></i><div id='Rolcb'><tfoot id='Rolcb'></tfoot><dl id='Rolcb'><fieldset id='Rolcb'></fieldset></dl></div>
      2. 通过 Intent 共享照片时删除 EXIF 位置数据

        时间:2023-09-01
        • <bdo id='zSV6y'></bdo><ul id='zSV6y'></ul>
          <tfoot id='zSV6y'></tfoot>

              • <i id='zSV6y'><tr id='zSV6y'><dt id='zSV6y'><q id='zSV6y'><span id='zSV6y'><b id='zSV6y'><form id='zSV6y'><ins id='zSV6y'></ins><ul id='zSV6y'></ul><sub id='zSV6y'></sub></form><legend id='zSV6y'></legend><bdo id='zSV6y'><pre id='zSV6y'><center id='zSV6y'></center></pre></bdo></b><th id='zSV6y'></th></span></q></dt></tr></i><div id='zSV6y'><tfoot id='zSV6y'></tfoot><dl id='zSV6y'><fieldset id='zSV6y'></fieldset></dl></div>

                    <tbody id='zSV6y'></tbody>

                  <small id='zSV6y'></small><noframes id='zSV6y'>

                  <legend id='zSV6y'><style id='zSV6y'><dir id='zSV6y'><q id='zSV6y'></q></dir></style></legend>
                  本文介绍了通过 Intent 共享照片时删除 EXIF 位置数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我最近将我的应用程序切换到了 Scoped Storage.但是,我注意到,当我从应用程序内(通过 Intent)共享图像时,GPS 位置数据会从图像的 Exif 元数据中删除.我知道 Scoped Storage 对访问图像的 Exif 位置数据有一些限制,并且我知道权限 <uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION"/>,但是添加此权限似乎在共享图像时没有任何效果.知道如何通过 Intent 共享图像,同时将位置数据保留在图像的 Exif 数据中吗?

                  I have recently switched my app to Scoped Storage. However, I have noticed that when I share an image from within the app (via an Intent), the GPS location data is removed from the image's Exif metadata. I am aware that Scoped Storage has some restrictions on accessing the Exif location data of an image and I am aware about the permission <uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />, however adding this permission does not seem to have any effect when sharing the image. Any idea how to share images via Intent while retaining the location data in the image's Exif data?

                  这是我的代码:

                   val imageUri = mediaList[photo_view_pager.currentItem].uri
                  
                   val intent = Intent().apply {
                       val mediaType = MimeTypeMap.getSingleton()
                          .getMimeTypeFromExtension("jpg")
                       putExtra(Intent.EXTRA_STREAM, imageUri)
                       type = mediaType
                       action = Intent.ACTION_SEND
                       flags = Intent.FLAG_GRANT_READ_URI_PERMISSION
                   }
                  
                   startActivity(Intent.createChooser(intent, getString(R.string.share_hint)))
                  

                  非常感谢您的任何帮助!

                  Thanks a lot in advance for any help!

                  推荐答案

                  我在 Android 11 上的体验.

                  My experiences on Android 11.

                  也必须在运行时请求 ACCESS_MEDIA_LOCATION.

                  Have to request ACCESS_MEDIA_LOCATION at runtime too.

                  服务应用应具有所有文件访问权限",以便接收应用从 exif 读取纬度、经度.

                  The serving app should have 'all files access' in order for the receiving app to read lat, lon from exif.

                  如果服务应用程序可以访问所有文件,则不需要 MediaStore.setRequireOriginal 从文件中读取 lat,lon 本身.

                  If the serving app has all files access it does not need the MediaStore.setRequireOriginal to read lat,lon itself from file.

                  (我从未使用过 MediaStore.setRequireOriginal,但现在将进行调查).

                  (I never used MediaStore.setRequireOriginal but will investigate now).

                  这篇关于通过 Intent 共享照片时删除 EXIF 位置数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:使用 Wifi 时查找当前位置有效,但使用 GPS 时失败 下一篇:Android 上服务的良好做法

                  相关文章

                  最新文章

                  <legend id='qpS3b'><style id='qpS3b'><dir id='qpS3b'><q id='qpS3b'></q></dir></style></legend>
                  1. <i id='qpS3b'><tr id='qpS3b'><dt id='qpS3b'><q id='qpS3b'><span id='qpS3b'><b id='qpS3b'><form id='qpS3b'><ins id='qpS3b'></ins><ul id='qpS3b'></ul><sub id='qpS3b'></sub></form><legend id='qpS3b'></legend><bdo id='qpS3b'><pre id='qpS3b'><center id='qpS3b'></center></pre></bdo></b><th id='qpS3b'></th></span></q></dt></tr></i><div id='qpS3b'><tfoot id='qpS3b'></tfoot><dl id='qpS3b'><fieldset id='qpS3b'></fieldset></dl></div>
                  2. <small id='qpS3b'></small><noframes id='qpS3b'>

                    1. <tfoot id='qpS3b'></tfoot>
                        <bdo id='qpS3b'></bdo><ul id='qpS3b'></ul>