我的问题是,当我想从 Gridview 单击图像时,我想使用 android 标准查看器显示它,请帮助我,这是我的代码!
public class ImageAdapterForGallery extends BaseAdapter {
private Context mContext;
public static Uri uri;
static File root = new File(Environment.getExternalStorageDirectory()
+ "/Rasha Bani Hani/");
static File[] gLry = root.listFiles();
int count = gLry.length;
public ImageAdapterForGallery(Context c) {
mContext = c;
}
public int getCount() {
return gLry.length; }
public Object getItem(int position) {
return gLry[position];
}
public long getItemId(int position) {
return position;
}
public View getView(int position, View convertView, ViewGroup parent) {
uri = Uri.fromFile(gLry[position]);
ImageView imageView;
imageView = new ImageView(mContext);
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
imageView.setLayoutParams(new GridView.LayoutParams(180, 180));
imageView.setImageURI(uri);
return imageView;
}}
在这里需要帮助!谢谢!