Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Use this code if you want to load from resources
- ImageView i = new ImageView(mContext);
- i.setImageResource(mImageIds[position]);
- i.setLayoutParams(new CoverFlow.LayoutParams(130, 130));
- i.setScaleType(ImageView.ScaleType.MATRIX);
- return i;
- public class ImageAdapter extends BaseAdapter {
- int mGalleryItemBackground;
- private Context mContext;
- private FileInputStream fis;
- private Integer[] mImageIds = {
- // R.drawable.pic01,
- // R.drawable.pic02,
- // R.drawable.pic03,
- // R.drawable.pic04,
- // R.drawable.pic05,
- // R.drawable.pic06,
- // R.drawable.pic07,
- // R.drawable.pic08,
- // R.drawable.pic09
- };
- private ImageView[] mImages;
- public View getView(int position, View convertView, ViewGroup parent) {
- ImageView i = new ImageView(mContext.getApplicationContext());
- imagecursor.moveToPosition(position);
- int id = imagecursor.getInt(image_column_index);
- i.setImageURIUri.withAppendedPathMediaStore.Images.Media.EXTERNAL_CONTENT_URI, ""+ id));
- i.setLayoutParams(new CoverFlow.LayoutParams(130, 130));
- i.setScaleType(ImageView.ScaleType.MATRIX);
- return i;
- //return mImages[position];
- }
- i.setImageBitmap(BitmapFactory.decodeFile(PATH_TO_YOUR_IMAGE_FILE_ON_SDCARD));
- i.setImageBitmap(BitmapFactory.decodeFile("image_" + position));
Add Comment
Please, Sign In to add comment