无法解析 android studio 中的 decodeFile 方法
Cannot resolve method decodeFile in android studio
我是原生 android 开发的新手。我正在 android 工作室工作。我有 3 tabs
。一个是 map
第二个是 camera
拍照,第三个是 pictures
,所有的照片都会被展示出来。我已经实现了 map
和 camera
,为了查看图像,我正在关注这个 tutorial。在 class 中我添加了 Bitmap image = Bitmap image = decodeFile(_filePaths.get(position), imageWidth, imageWidth);
但它向我显示错误 Cannot Resolve method decodeFile
。我已经搜索过了,但找不到任何解决方案。
下面是我的代码
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ImageView imageView;
if (convertView == null) {
imageView = new ImageView(_activity);
} else {
imageView = (ImageView) convertView;
}
// get screen dimensions
Bitmap image = decodeFile(_filePaths.get(position), imageWidth, imageWidth);
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
imageView.setLayoutParams(new GridView.LayoutParams(imageWidth,
imageWidth));
imageView.setImageBitmap(image);
// image view click listener
imageView.setOnClickListener(new OnImageClickListener(position));
return imageView;
}
非常感谢任何帮助。
使用这个
Bitmap image = BitmapFactory.decodeFile(_filePaths.get(position), imageWidth, imageWidth);
它是在 class 中定义的自定义方法(在教程中您应该没有复制名为 decodeFile() 的方法)再次检查..
我是原生 android 开发的新手。我正在 android 工作室工作。我有 3 tabs
。一个是 map
第二个是 camera
拍照,第三个是 pictures
,所有的照片都会被展示出来。我已经实现了 map
和 camera
,为了查看图像,我正在关注这个 tutorial。在 class 中我添加了 Bitmap image = Bitmap image = decodeFile(_filePaths.get(position), imageWidth, imageWidth);
但它向我显示错误 Cannot Resolve method decodeFile
。我已经搜索过了,但找不到任何解决方案。
下面是我的代码
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ImageView imageView;
if (convertView == null) {
imageView = new ImageView(_activity);
} else {
imageView = (ImageView) convertView;
}
// get screen dimensions
Bitmap image = decodeFile(_filePaths.get(position), imageWidth, imageWidth);
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
imageView.setLayoutParams(new GridView.LayoutParams(imageWidth,
imageWidth));
imageView.setImageBitmap(image);
// image view click listener
imageView.setOnClickListener(new OnImageClickListener(position));
return imageView;
}
非常感谢任何帮助。
使用这个
Bitmap image = BitmapFactory.decodeFile(_filePaths.get(position), imageWidth, imageWidth);
它是在 class 中定义的自定义方法(在教程中您应该没有复制名为 decodeFile() 的方法)再次检查..