0

Is it possibile to open image in dialog without creating new activity?

If yes how to transfer this photo to a dialog.

1 Answers1

0
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();
Khemraj Sharma
  • 57,232
  • 27
  • 203
  • 212