I have a method "getUrls" that read data from a json file in internet by volley and return a string array that contain some urls in onCreate method first I invoke this method to get urls then pass urls to my view pager adapter to download image by picasso but there is problem getUrls method is trying to download json file may string array is empty and I pass empty array to adapter so reading code should be stoped until getUrls coming finish here is my onCreate method: I have a method "getUrls" that read data from a