title: how to set an onclick listener for an imagebutton in an alertdialog
body: <p>I have a layout with an ImageButton that is inflated in an AlertDialog, where/how should I set an onClick listener?</p>
  
  <p>Here's the code I tried using:</p>
  
  <pre><code>    ImageButton ib = (ImageButton) findViewById(R.id.searchbutton);
      ib.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              Toast.makeText(TravelBite.this, "test", Toast.LENGTH_SHORT).show();
          }
      });
  </code></pre>