I've been needing to get a solution for this problem. I've already searched and tested many solutions from this community but anyone was fit for helping me.
I have two activities, the first one takes a picture and sends it to another which has an ImageView to receive that (until here i'm getting problems) and a query to insert the file path in the database (the code which do this last part is well).
I guess its better for the View load an Image Low Resolution as a Thumbnail. Therefore, to save into the database i wanna get the whole path from a full size picture.
Whether possible the images must to be inside a specific directory that i can choose the name given parameters to the function.
Perhaps anyone also knows how to set the smallest resolution from the camera automatically.
Example of get full size picture and thumbnail with
camera
intentfirst declare a button to take a picture...
Then in
onActivityResult
we are getting the data...For memory leak use this functions
Note: decodeSampledBitmap is a function to better performance in memory leak, like when you get OOM(out of memory)....
Loading Large Bitmaps Efficiently
If you want to have the full size picture, you need to provide the URI on the Intent's extra Data. Doing it this way, no thumbnail is returned, so you need to generate your own.
For modifying the second Activity, you can update your ImageView with the path saved in your DB using the onResume() method of your second Activity; just be sure to validate it's not null.
An easy way to generate thumbnails: