Difference between a custom AlertDialog and a custom Dialog
<p>I am wondering what is the difference of having a custom Dialog as opposed to a custom AlertDialog is? Is it the fact that they offer free functionality in the form of buttons, lists, checkboxes etc in the dialog?</p>

<p>Secondly, I was wondering if the code fragment for custom AlertDialog available @ <a href="http://developer.android.com/guide/topics/ui/dialogs.html" rel="nofollow">http://developer.android.com/guide/topics/ui/dialogs.html</a> (code reproduced below) is complete. I tried using it and it crashes the moment I call dialog.show():</p>

<pre><code>AlertDialog.Builder builder;
AlertDialog alertDialog;

Context mContext = getApplicationContext();
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(
                             LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.custom_dialog,
                           (ViewGroup) findViewById(R.id.layout_root));

TextView text = (TextView) layout.findViewById(R.id.text);
text.setText("Hello, this is a custom dialog!");
ImageView image = (ImageView) layout.findViewById(R.id.image);
image.setImageResource(R.drawable.android);

builder = new AlertDialog.Builder(mContext);
builder.setView(layout);
alertDialog = builder.create();
</code></pre>

<p>While code for creating a custom dialog (which works) is much simpler:</p>

<pre><code>Dialog dialog = new Dialog(MyActivity.this);
dialog.setContentView(R.layout.dialog_custom);
dialog.setTitle("Shopping List Name");
dialog.setCancelable(true); 
dialog.show();
</code></pre>

<p>Thanks for you patience.</p>

<p>M@nish</p>

<p>Edit: I got it to work finally. I think I now understand the difference between Dialog and AlertDialog. I've documented this @ <a href="http://geekjamboree.wordpress.com/2011/11/19/dialog-vs-alertdialog/" rel="nofollow">http://geekjamboree.wordpress.com/2011/11/19/dialog-vs-alertdialog/</a></p>
