My original goal here was a modal dialog, but you know, Android didn\'t support this type of dialog. Alternatively, building a dialog-themed activity would possibly work.
Just a quick update on @user824330 answer. Since you have the AlertDialog.Builder class, why not using it properly? Many methods are now deprecated. The up-to-date code would be similar to this:
public class DialogActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("title")
.setMessage("message")
.setIcon(R.drawable.ic_launcher)
.setPositiveButton("Yes", new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {}
})
.setNegativeButton("No", new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {}
});
final AlertDialog dialog = builder.create();
dialog.show();
}
}