i am new to android and i want to set an image as background to different fragments in an activity.But the images are to large that they make my application to increase in memory and i don't want this. The activity have 6 different fragments and each have different background, here i set the background images from drawable. i referred this.but i didn't get correct solution. How could i make them so that the memory size of images will be less? Android - Reduce the memory usage of Bitmap Drawables
Asked
Active
Viewed 2,370 times
0
-
You can resize your image and decrease your image size. – CompEng Apr 07 '14 at 07:22
1 Answers
2
On this concrete case you have 2 options:
1 - Set the image as background on the root view of your fragment Layout. Doing that you'll avoid out of emmory errors, but the image will be scalled to fullfill the whole screen, so it could be diformed.
2 - Use Picasso library http://square.github.io/picasso/ to load the file images. It can be helpful to manage memory issues.
Also, the best thing you could do before starting is to reduce the size of the images using some software such as https://tinypng.com/.
Hope it helps

JasJar
- 336
- 3
- 14