Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8823547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:23:02+00:00 2026-06-14T06:23:02+00:00

my target scenario: User opens an attachment in his/her preferred email-app. My app is

  • 0

my target scenario: User opens an attachment in his/her preferred email-app. My app is proposed to open/view the attachment, user chooses my app, my app opens the attachment-uri via ContentResolver.openInputStream(uri) and reads from it.

This normally works great. It has come to my attention though, that several email-apps now require special permissions like: com.fsck.k9.permission.READ_ATTACHMENT, com.android.email.permission.READ_ATTACHMENT, com.motorola.blur.service.email.Permissions.INTERACT, etc.

I think it is bad design to add a uses-permission-tag for each and every email-app on the market. Is there a better way to be able to generally read attachments?

Furthermore – even if I decide to continuosly add uses-permissions to my app with every release, I run into another problem: If the app that requires the permission is installed after my app, my app will not have the permission, because at the time of my apps installation it wasn’t known to the packagemanager that such an permission even existed.

So – do I really have to instruct my users to reinstall my app if they decide to switch to a new email-app that my app already has uses-permissions for? Just because my app was first on their system??

Any help would be greatly appreciated. Thanks for reading!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T06:23:03+00:00Added an answer on June 14, 2026 at 6:23 am

    I am now able to remove all these Custom-Permissions from my app and still able to read attachments.

    Turns out I was doing everything right, except for one little thing…

    … I was handling reading the attachment in two Activities. The first Activity – my main Activity – is responsible for gathering the Intent-information and selecting/preparing a database for storing the to-be-imported data. The second Activity is actually reading from the InputStream obtained via ContentResolver and importing into the database.

    Turns out that FLAG_GRANT_READ_URI_PERMISSION only grants permission to the recipient of the Intent. As I was passing on the Uri of the attachment to a second Activity it could not be read there anymore – only by granting my app several custom Permissions, a solution I can’t really recommend as described above.

    My solution now is to read all the data in my first Activity, storing it in a temporary file and passing this file-Uri to my second Activity. Of course now I have to care about how long copying takes, maybe display progress dialogs and determine where I can find enough space for my temp, accessing the original-Uri seemed quite a lot easier.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the scenario I have values assigned like these Amazon -1 Walmart -2 Target
The scenario is this: select max date from some table, when the target table
So this is the scenario. I have <target name=test> <property file=blah></property> <exec dir= executable=trast.exe
[Revision 5/14/09: I need this to target Dotnet 2.0 because of my deployment scenario]
I have a scenario where I need to check if rows in a target
I having the scenario of loading the data from source table to target table.
my scenario is that when ever my target is achieve i want to show
I've met a scenario: save or update some data in a target table by
I am trying to test a scenario where my app writes some files to
OK so here is the scenario, I want the user to be able to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.