With reference to the question asked in the same category, and as an extension of this:
How to get the file path from a URI that points to a PDF document?
(How to get the file path from a URI that points to a PDF document?)
My question:
In my HTC 816 Desire phone [Note: this device is upgraded to MarshMallow but still has crashes of KitKat. As a developer, I have experienced that Camera opened by intent to get the image captured by it, never releases its resources. This gives me an internal crash, when I try to take the second picture.], the returned path is starting with "/document/primary:"
, and it is retained in 'pdfUri.getPath()'
resulting in file not found exception. Also when I search in 'MediaStore.Images.Media.DATA'
, column index returned is -1.
Q1. Should I simply remove "/document/primary:"
from the file path, when the column index comes -1. As because in higher phones (23 and above), this (pdfUri.getPath()) works OK, giving me correct path.
Q2. Where should I get the patches for my phone to fix Camera resource not releasing
bug, and there are other bugs at Firm-Ware level.
Please guide me, as well, by asking this question correctly, if in case it is not been asked accurately.