我正在尝试在android对话框中设置图像视图。如果我从图库中选择图像,则会在对话框中显示所选图像。我将尝试从厨房获取图像并将其传递到警报对话框的路径。

最佳答案

AlertDialog.Builder ImageDialog = new AlertDialog.Builder(MainActivity.this);
ImageDialog.setTitle("Title");
ImageView showImage = new ImageView(MainActivity.this);
ImageDialog.setView(showImage);

ImageDialog.setNegativeButton("ok", new DialogInterface.OnClickListener()
{
    public void onClick(DialogInterface arg0, int arg1)
    {
    }
});
ImageDialog.show();

10-04 16:59