我有一個圖像,我目前正在將它設置在imageview上。在對話框中顯示圖像
我希望當點擊Imageview時,會彈出一個對話框,顯示圖像..任何方法我怎麼能實現這一點。
Context mContext = getApplicationContext();
Dialog dialog = new Dialog(mContext);
dialog.setContentView(R.layout.customdialog);
dialog.setTitle("wateva");
ImageView ivDialog = (ImageView) dialog.findViewById(R.id.ivDialog);
String filepath = Environment.getExternalStorageDirectory().getPath();
folder = new File(filepath,"checking");
File fa = new File(folder,"bmp1.png");
Bitmap bmpa = BitmapFactory.decodeFile(fa.getAbsolutePath());
Log.d("error " , "here");
ivDialog.setImageBitmap(bmpa);
dialog.show();
做ü谷歌搜索:http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog –