0
I’m putting together an album, and with the code below, I can see all the images:
@Override
public View getView(int position, View view, ViewGroup viewGroup) {
view = getLayoutInflater().inflate(R.layout.grid_item_layout , viewGroup, false);
ImageView image = (ImageView) view.findViewById(R.id.image);
image.setImageURI(Uri.parse(getItem(position).toString()));
return view;
}
Only this way, the memory device runs out too fast. So I found two Apis that were supposed to do the same job: Picasso and Glide. But when using these lines, images do not appear in Imageview.
@Override
public View getView(int position, View view, ViewGroup viewGroup) {
view = getLayoutInflater().inflate(R.layout.grid_item_layout , viewGroup, false);
ImageView image = (ImageView) view.findViewById(R.id.image);
//Nenhuma das duas abaixo funciona
//Picasso.with(getApplication()).load(Uri.parse(getItem(position).toString())).into(image);
//Glide.with(GaleriaActivity.this).load(Uri.parse(getItem(position).toString())).into(image);
return view;
}
Upshot:
How can I fix this?
It worked, vlw by the help.
– Everson D. Ferreira
@Eversond.Ferreira I’ll give a +1 on your question, I don’t want it to be negative. Other people can go through the same problem.
– viana