问题
I have implemented an application for get the images from external storage when user click on a image button.if user click on a button i can get the images from sd card.but i can't view the slide show for get the images on by one there.I have implemented code as follows:
((ImageView)findViewById(R.id.getImage)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivity(intent);
}
});
From the above code i am getting all images from sdcard but i can't view android inbuilt slide show image viewer.
How can i get android slide show image viewer?
please any body help me....
回答1:
use ViewFlipper
ViewFlipper vf=(ViewFlipper)findViewById(R.id.ViewFlipper1);
ImageView img=(imageView)findviewById(R.id.imageView1);
Button btn=(Button)findViewById(R.id.button1);
img.setOnClickListener(this);
btn.setOnClickListener(this);
public void OnClick(View v)
{
Switch(v.getId())
{
case R.id.imageView1 :
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivity(intent);
vf.showNext();
break;
case R.id.button1:
vf.showPrevious();
break;
}
来源:https://stackoverflow.com/questions/9616419/how-can-i-get-android-inbuilt-image-gallery-in-to-my-application