I was able to solve it. In my class, Pageradapter, I did the following:
@Override
public Object instantiateItem(ViewGroup container, int position) {
RelativeLayout relativeLayout = new RelativeLayout(context);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
relativeLayout.setLayoutParams(layoutParams);
container.addView(relativeLayout);
ImageView imageView = new ImageView(context);
imageView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
relativeLayout.addView(imageView);
RelativeLayout progressLayout = new RelativeLayout(context);
progressLayout.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,
RelativeLayout.LayoutParams.MATCH_PARENT));
progressLayout.setGravity(Gravity.CENTER);
relativeLayout.addView(progressLayout);
ProgressBar progressBar = new ProgressBar(context,null,android.R.attr.progressBarStyleLarge);
progressBar.setVisibility(View.GONE);
progressBar.setIndeterminate(true);
progressLayout.addView(progressBar);
try {
new ImageLoadTask(imagesUrl[position], imageView , progressBar).execute();
}catch (Exception e){
Log.e("Error" , e.getMessage());
}
return relativeLayout;
}//instantiateItem
Now just work the Progressbar on Asynctask.