Close the Inflated layout on click on button
<p>I want to close this inflated layout when click on button of inflated layout. How to achieve this please help me.</p>

<pre><code>li = LayoutInflater.from(VMAdjustFrame.this);
promptsView = li.inflate(R.layout.wishlist_save_prompt, null);
alertDialogBuilder = new AlertDialog.Builder(VMAdjustFrame.this);
alertDialogBuilder.setView(promptsView);
alertDialogBuilder.show();

TextView textView = (TextView)promptsView.findViewById(R.id.textView1);
textView.setText(context.getString(R.string.share_photo));
</code></pre>

<p>Listener is called when click on email button</p>

<pre><code>Button emailButton = (Button)promptsView.findViewById(R.id.phoneButton);
emailButton.setText(context.getString(R.string.share_photo_email));
emailButton.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View v) {

    }
});
</code></pre>
