I have to display around 100 icons (each 50x50) in Button. I am downloading big png Image which contains all 100 icons, then I create each icon using Image.subImage() method.
But my application getting OutOfMemoryError.
I am thinking about 2 solution for this: 1) download 100 icons as tar(combined into single) file. So i can create icon one by one. Big Image need not to be in memory till I create last icon. 2)Download big Image but dont create small icon.Then override Button class to paint image (icon) from big Image.
Which is the best solution? or do you have any other solution for this problem.