1

Issues Faced

I was able to get image url data using Okhttp but then store it on an arraylist but was faced with an issue because this processes takes time so when my activity start the view is seen before the data is received.

I am querying image urls from the server then displaying/loading them to a recycler view using picasso help please...?

3 Answers3

0

Use a progressDialog until receive your image urls from server and then dismiss it and then load it with picasso.

//before starting connection 
progressDialog.show();

//on Connection complete:
progressDialog.dismiss();
Reza.Abedini
  • 2,227
  • 2
  • 16
  • 18
0

Loading the data from the api should be an asynchronous process, if you want to notify the user while that is happening, you can show a progress bar.

Upon receiving the data from the server, hide the progress bar and then load the images in the picasso, you can also specify a default image to picasso, which will be shown while the image itself is being loaded.

SanthoshN
  • 619
  • 3
  • 15
0

You can show image using Picasso library using this code :

Picasso.with(context)
.load(post_pic_url)
.placeholder(R.drawable.placeholder_post)  // use a placeholder image here
.fit()  // to fit image on image view
.centerCrop()
.into(imgPost); // your image view object

If any explaination then please let me know in comments

Parvindra Singh
  • 53
  • 2
  • 10