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();
ボタンが押されたときに画像付きのポップアップを表示しようとしています。上記のコードは、機能していない私の試みです。cardpath
変数は、画像の絶対パスの文字列であると想定されています。ただし、ボタンを押しても何も表示されません。カードパスで定義されたイメージは実際に存在し、外部ストレージの読み取り権限があるため、何が問題なのかわかりません。