title: ImageView inside AlertDialog
body: <p>This is my first android app and i'm new in programming, i want to show imageView inside AlertDialog, actually i searched for that but i just found that i must specify the image in the xml layout file!</p>
  
  <p>like that <a href="https://stackoverflow.com/a/6276592/4043944">one, </a>
  i just want to get that image from the java code not from xml because that image generated by the user</p>
  
  <p>That's part from my code:</p>
  
  <pre><code>                EditText et = (EditText) findViewById(R.id.editText);
  
                  final Bitmap bm = QRCode.from(et.getText().toString()).bitmap();
  
                  ImageView iv = (ImageView) findViewById(R.id.imagev);
                  iv.setImageBitmap(bm);
  
                  Button btn = (Button) findViewById(R.id.button);
  
                  btn.setOnClickListener(new View.OnClickListener() {
                      @Override
                      public void onClick(View v) {
                          AlertDialog.Builder b = new AlertDialog.Builder(MainActivity.this);
                          b.setMessage("Want to save it?");
                          b.setView(iv);
                          b.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                              @Override
                              public void onClick(DialogInterface dialog, int which) {
                                  Toast.makeText(getApplicationContext(),
                                          "Tapped on YES!", Toast.LENGTH_SHORT)
                                          .show();
                              }
                          });
                          b.setNegativeButton("Delete", new DialogInterface.OnClickListener() {
                              @Override
                              public void onClick(DialogInterface dialog, int which) {
                                  Toast.makeText(getApplicationContext(),
                                          "Tapped on DELETE!", Toast.LENGTH_SHORT)
                                          .show();
                              }
                          });
  
                          AlertDialog ad = b.create();
                          ad.show();
                      }
                  });
  </code></pre>
  
  <p>I want to display that "iv" in the dialog, thanks! :)</p>