I've got a SendActivity, that launches an UploadService.
The problem happens when i let the SendActivity then immediately starts another activity and finishes itself. The UploadService gets the file, that it's supposed to upload, from a content provider. But when the SendActivity isn't i the foreground in the moment the service tries to access the file through the provider I get a "Permission Denial" although the permission is listed in my manifest.
java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaDocumentsProvider uri content://com.android.providers.media.documents/document/image%3A24669 from pid=28913, uid=10441 requires android.permission.MANAGE_DOCUMENTS, or grantUriPermission()
at android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:646)
Can anybody help me out?