DialogにボタンなどのViewを追加したい場合のメモです。
まず、Dialogの中身をカスタマイズしたい場合の実装の仕方ですが、ApiDemos > app > dialog の中にLayoutInflaterを使ってViewをカスタマイズしている例があります。しかし、このサンプルコードにはリスナーの登録方法が示されていません。
で、いきなり結論ですが、下記のように実装すればリスナーを登録できます。下の例では、SeekBarのリスナーを定義してます。赤字で示したViewの参照取得の箇所が肝です。

public void onCreate(Bundle savedInstanceState) 
{
super.onCreate(savedInstanceState);
// Dialogを表示
showDialog(MY_DIALOG);
}

@Override
protected Dialog onCreateDialog(int id)
{
switch (id)
{
case MY_DIALOG:
LayoutInflater factory = LayoutInflater.from(this);
final View editView = factory.inflate(R.layout.edit, null);
// Viewの参照を取得
SeekBar seekbar = (SeekBar) editView.findViewById(R.id.SeekBar); // ATTENTION : editViewからたどる
seekbar.setMax(100);
seekbar.setProgress(0);
// リスナー定義
seekbar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
public void onProgressChanged( SeekBar _seekBar, int progress, boolean fromTouch) {
Log.v("onProgressChanged()", String.valueOf(progress) + ", " + String.valueOf(fromTouch));
}
public void onStartTrackingTouch(SeekBar _seekBar) {}
public void onStopTrackingTouch(SeekBar _seekBar) {}
});
Builder builder = new AlertDialog.Builder(MainActivity.this)
.setIcon(R.drawable.dialog_icon)
.setTitle(R.string.dialog_text_entry)
.setView(editView)
.setPositiveButton(R.string.dialog_ok, new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int whichButton) {}
})
.setNegativeButton(R.string.dialog_cancel, new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int whichButton) {}
});
Dialog editDialog = builder.create();
return editDialog;
default:
break;
}
return null;
}
Dialog editDialog = builder.create();
return editDialog;
default:
break;
}
return null;
}


※この実装方法はAndroid-SDK-Japanで教えていただきました。
→ Dialogをカスタマイズした際のリスナーの実装の仕方