Hey all. I'm new here, hoping to learn a lot from these forums and hopefully get some help should I need it, and even provide it if I can.
So I'm making just a play application (my first one - something small). But I have a problem.
It's a contact application (manages contacts within the application only so far) you can set an image, and whenever you load the contact list, it displays that. If the user adds a new contact, with an image, then goes to view contacts, the image shows.
If they add the user, then close the application process, then re-open it, the image is blank and i get the error:
I've researched this a lot, heard a lot about perm permissions, kitkat, but I really feel like they don't apply to me and wouldn't even have a clue on how to integrate the solutions into my code.
My code is here: http://pastebin.com/UU7QU0rV
I have 4 classes (including this one) - Contact (simple object of a contact, holds the URI, name, etc). Database (Handles all of the database stuff, so when creating a new contact its added there, and then every time the app boots it loads all contacts from the database, this also stores the URI for the image), then EditContact (which is what im working on right now, but works fine).
At line 306 I try to set up the image with the contacts image, this throws the permission denied and thus the image is blank.
However, if the user adds a contact with the exact same image, (or edits a contact and changes their image) then the contact with the same image (but blank because of permission) will then show the image in the program.
Can someone tell me how to fix this error? I've tried adding permissions to my manifest, but it does nothing.
So I'm making just a play application (my first one - something small). But I have a problem.
It's a contact application (manages contacts within the application only so far) you can set an image, and whenever you load the contact list, it displays that. If the user adds a new contact, with an image, then goes to view contacts, the image shows.
If they add the user, then close the application process, then re-open it, the image is blank and i get the error:
Code:
java.lang.SecurityException: Permission Denial: opening provider com.android.providers.media.MediaDocumentsProvider from ProcessRecord{2a33f682 31420:com.joelmale.android.contactmanager/u0a60} (pid=31420, uid=10060) requires android.permission.MANAGE_DOCUMENTS or android.permission.MANAGE_DOCUMENTS
I've researched this a lot, heard a lot about perm permissions, kitkat, but I really feel like they don't apply to me and wouldn't even have a clue on how to integrate the solutions into my code.
My code is here: http://pastebin.com/UU7QU0rV
I have 4 classes (including this one) - Contact (simple object of a contact, holds the URI, name, etc). Database (Handles all of the database stuff, so when creating a new contact its added there, and then every time the app boots it loads all contacts from the database, this also stores the URI for the image), then EditContact (which is what im working on right now, but works fine).
At line 306 I try to set up the image with the contacts image, this throws the permission denied and thus the image is blank.
However, if the user adds a contact with the exact same image, (or edits a contact and changes their image) then the contact with the same image (but blank because of permission) will then show the image in the program.
Can someone tell me how to fix this error? I've tried adding permissions to my manifest, but it does nothing.


).