I am working on android app and i have a images slider in my app,now i want to when i click on my slider image,the images are display in another activity but it takes a little time while to open,now i want to implement and add a loading progress bar when display the image in another activity,can anyone tell me how i can implement progress bar when i click my image slider and when open another activity it's start progressbar and when images are display it's dimiss?any help,idea and sugession will be much appreciated,Thanks in advance.
This is my activity when i click on my image and anothe activity open:
iv_openimage = (ImageView) findViewById(R.id.iv_openimage);
iv_openimage.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent(VarientDetails.this,ImageSwitcher.class);
intent.putExtra("imageurls", imageurls);
Log.d("CMH", "images url = " + imageurls);
startActivity(intent);
}
});
and this is my imageswitcher activity were i can display my images:
public class ImageSwitcher extends Activity {
ImageView iv_getimage;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.imageswitcher);
iv_getimage = (ImageView) findViewById(R.id.imageView1);
ArrayList<String> resultArray = getIntent().getStringArrayListExtra("imageurls");
Log.d("CMH imgswtchr", "images url = " + resultArray);
Picasso.with(getBaseContext()).load(resultArray.get(0))
.into(iv_getimage);
}
}