I believe that the best way to solve your problem would be to put the images in the Assets folder, which is always better if this folder is created in ".. /app/main/Assets", in my case, I use this function below to take the images from the Assets folder, fill a list with them and process them as I want:
private ArrayList<Bitmap> getImages(Context c) {
String[] _List;
String[] files = new String[0];
ArrayList<Bitmap> result = new ArrayList<Bitmap>();
// abre a pasta assets usando AssetManager
AssetManager assetManager = c.getAssets();
try {
// "myfolderimages" é uma pasta na minha pasta assetes
// aqui eu preciso inverter a ordem delas segundo o criterio "wH"
// nessa linha eu preencho uma lista com os nomes dos arquivos na pasta
_List = c.getAssets().list("myfolderimages");
files = wH.equals("S") ? _List : display.reverseList(_List);
} catch (IOException e) {
e.printStackTrace();
}
if (files != null)
for (int i = 0; i < files.length; i++) {
InputStream open = null;
try {
// nesta linha eu preencho o array com as imagens contidas na lista de nomes
open = assetManager.open("myfolderimages/" + files[i]);
Bitmap bitmap = BitmapFactory.decodeStream(open);
result.add(RotateBitmap(bitmap, 30.0f));
} catch (IOException e) {
e.printStackTrace();
} finally {
if (open != null) {
try {
open.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
// retorna o array com as imagens
return result;
}
So I use it like this:
// ...
List<Bitmap> images = new ArrayList<Bitmap>();
// ...
LinearLayout meuLayout = new LinearLayout(this);
images = getImages(context);
// ...
ImageView minhaImagem = new Imageview(this);
minhaImagem.setImageBitmap(images.get(10);
meulayout.addview(minhaImagem);
setcontentview(meulayout);
this is just an example, adapite it as per your need
hope it helps
Oops, Thank you very much for the attention but that’s not what I need, I already have the images in bitmap array, I need to put in the autocomplete the images ... In this link above has exactly what I want to do but it is inserting the images by drawable Resource I have the bitmap array and I want to insert from bitmap, as they will be images that I will receive from the url.
– searchsolucao
ok, so, but taking the images from the array and converting them to drawable is the same as taking images by Resource drawable
– Armando Marques Sobrinho
I’ve tried this way, converting the images to drawable and even then it didn’t work because in the "put" there it loads the images by Resource and not drawable ... In the link the example shows the images in drawable porem in Resource so even converting does not work!.
– searchsolucao
put your code so I can look
– Armando Marques Sobrinho