When i pass captured image result from one activity to another activity image is loosing quality and getting blur. Is there any way to pass big size image from one activity to another activity without loosing quality???
Asked
Active
Viewed 51 times
-2
-
are you passing bitmap ?? – SahdevRajput74 Feb 13 '18 at 06:43
-
Do not pass bitmap in bundle . Instead of it you can use a Singleton Utility class to set the bitmap . – ADM Feb 13 '18 at 06:43
-
@ADM, I'd not suggest doing that. – Vladyslav Matviienko Feb 13 '18 at 06:44
-
@VladMatvienko So what you suggest then let me know .Passing local Url can be a solution . What you think will be best. – ADM Feb 13 '18 at 06:45
-
1I'd save Bitmap to file, and passed URI to it to the next activity through bundle – Vladyslav Matviienko Feb 13 '18 at 06:50
-
Yeah thats what i think . the Singleton approach can also work in case of a bitmap . but we need to take care of recycling it once the work done .Thx – ADM Feb 13 '18 at 07:05
-
yes i am passing a bitmap @SahdevRajput74 – Gunjan Sharma Feb 13 '18 at 07:10
1 Answers
0
Avoid passing large objects via Bundle, use LruCache<Bitmap>
to cache the Bitmap in memory for quick retrieval on the other end. See this link
https://developer.android.com/reference/android/util/LruCache.html

martinomburajr
- 1,235
- 14
- 29