android弹出窗口中未出现/未找到图像

android弹出窗口中未出现/未找到图像,android,imageview,android-alertdialog,bitmapfactory,Android,Imageview,Android Alertdialog,Bitmapfactory,我试图在按下按钮时弹出一个带有图像的弹出窗口。上面的代码是我的尝试,但不起作用。cardpath变量应该是图像绝对路径的字符串。但是,按下按钮时不会显示任何内容。cardpath定义的图像确实存在,并且我具有外部存储读取权限,因此我不确定出了什么问题。由于我没有看到您缩放图像,请检查日志猫-您可能会看到一行OpenGLRenderer=位图太大,无法上载到纹理中 String cardpath = Global.directory + longPressBtn.getText().toStrin

我试图在按下按钮时弹出一个带有图像的弹出窗口。上面的代码是我的尝试,但不起作用。
cardpath
变量应该是图像绝对路径的字符串。但是,按下按钮时不会显示任何内容。cardpath定义的图像确实存在,并且我具有外部存储读取权限,因此我不确定出了什么问题。

由于我没有看到您缩放图像,请检查日志猫-您可能会看到一行OpenGLRenderer=位图太大,无法上载到纹理中

String cardpath = Global.directory + longPressBtn.getText().toString() + ".jpg";
System.out.println(cardpath);

AlertDialog imageDialog = new AlertDialog.Builder(mContext).create();
LayoutInflater inflater = LayoutInflater.from(mContext);
imageDialog.setTitle("Title");
View view = inflater.inflate(R.layout.cardpopup, null); 
File imgFile = new File("cardpath");
Bitmap myBitmap = BitmapFactory.decodeFile(cardpath);

ImageView myImage = new ImageView(mContext);
myImage.setImageBitmap(myBitmap);

imageDialog.setView(view);
imageDialog.show();