0
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変数は、画像の絶対パスの文字列であると想定されています。ただし、ボタンを押しても何も表示されません。カードパスで定義されたイメージは実際に存在し、外部ストレージの読み取り権限があるため、何が問題なのかわかりません。

4

1 に答える 1

0

Since i don't see you scaling your image, check your logcat - you will probably see a line OpenGLRenderer = Bitmap too large to be uploaded into a texture.

于 2013-06-14T05:39:27.653 に答える