Try this.
inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate(R.layout.resize_dialog,null);
seekbar = (SeekBar)view. findViewById(R.id.seekBar2);
/** Add that inflated view to AlertDialog */
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.app_name);
builder.setView(view);
use this for cancelling Dialog. i.e dialog.dismiss();
.setPositiveButton(
getResources().getString(R.string.Cancel),
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int whichButton) {
dialog.dismiss();
}
});
alert = builder.create();
alert.show();