reading images from memory card ANDROID
int image[] =
{R.drawable.d002_p001,R.drawable.d002_p002,R.drawable.d002_p003,
R.drawable.d002_p004,R.drawable.d002_p005,R.drawable.d002_p006};
showPhoto(imCurrentPhotoIndex);
protected void onSaveInstanceState(Bundle outState) {
outState.putInt("photo_index", imCurrentPhotoIndex);
super.onSaveInstanceState(outState);
}
protected void onRestoreInstanceState(Bundle savedInstanceState) {
imCurrentPhotoIndex = savedInstanceState.getInt("photo_index");
showPhoto(imCurrentPhotoIndex);
super.onRestoreInstanceState(savedInstanceState);
}
private void showPhoto(int photoIndex) {
ImageView imageView = (ImageView) findViewById(R.id.image_view);
// imageView.setImageResource(imPhotoIds[photoIndex]);
imageView.setImageResource(imPhotoIds[photoIndex]);
}
above code is used to read and display images from drawable folder. I want
read images from a folder in memory card; what i should do?
No comments:
Post a Comment