I am trying to create a picker for images inside my app and I am having hard times with memory management. The pics are high resolution camera pictures, with 5mb each (minimum).
When showing the picker, which is a GridView.builder
builder The app starts lagging so much, and it starts displaying the images late and it is not good visually specially when I have to display 12 pictures at once.
The Console would start showing the memory trimming debug messages and a strange for input
counter message.
For input string: "-1,433"
V/ActivityThread(19862): Trimming memory to level: 10
V/ActivityThread(19862): Trimming memory to level: 15
For input string: "-1,399"
For input string: "-1,444"
For input string: "-1,394"
For input string: "-1,357"
For input string: "-1,271"
For input string: "-1,229"
For input string: "-1,136"
For input string: "-1,201"
For input string: "-1,154"
Lost connection to device.
Please help. how do I deal with this? Is there anyway other than manually creating thumbnails of each photo in the background and using it ?