In my search suggestions drop down in my app, I want to display a thumbnail next to the search suggestion (like Google Play does). This thumbnail will be downloaded from the internet. Currently, I am downloading the image as a bitmap, multiplying its dimensions by an guessed number, saving it as a JPEG, and then using the URI of the saved image to display in the search suggestion. Then, this for adding the suggestion to my list of search suggestions in the ContentProvider class: String[] row = {String.valueOf(i), imageUri.toString(), title, title}; cursor.addRow(row);
THERE HAS TO BE A BETTER WAY OF DOING THIS. It is slow, and I usually run out of memory resizing all those bitmaps.
How can I "simply" get the image from URL and set it as the SUGGEST_COLUMN_ICON_1 in the search suggestion?