views:

41

answers:

2

Just a simple problem without any idea of how to do it. Does anyone know how/if this can be done?

Reason: I just want one solid dialog box with no partitions as it looks a little better in my application.

EDIT

public void showCustomDialog() {
    Dialog dialog = new Dialog(this);

    dialog.setContentView(R.layout.customdialog);

    TextView thisText = (TextView) dialog.findViewById(R.id.customDialogThisText);
    thisText.setText("This");
    TextView thatText = (TextView) dialog.findViewById(R.id.customDialogThatText);
    thatText.setText("That");
    ImageView image = (ImageView) dialog.findViewById(R.id.customDialogImageView);
    image.setImageResource(R.drawable.icon);

    //Crashes the program with an AndroidRuntimeError
    //dialog.requestWindowFeature(dialog.getWindow().FEATURE_NO_TITLE);

    dialog.show();
}

+1  A: 

Just don't call setTitle() and there will be no title, like that:

alt text

LayoutInflater factory = LayoutInflater.from(this);
final View textEntryView = factory.inflate(R.layout.alert_dialog_text_entry, null);
new AlertDialog.Builder(AlertDialogSamples.this)
    .setView(textEntryView)
    .setPositiveButton(R.string.alert_dialog_ok, new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int whichButton) {

            /* User clicked OK so do some stuff */
        }
    })
    .setNegativeButton(R.string.alert_dialog_cancel, new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int whichButton) {

            /* User clicked cancel so do some stuff */
        }
    })
    .create();
Fedor
It just pops up with a blank title box then. Any other ideas?
TehGoose
Show us how you're calling your dialog box then. It shouldn't have a title section by default
Falmarri
@Fedor Are you able to show any sample code for how you created the Dialog box shown? I have been using code from this post: http://stackoverflow.com/questions/2644134/android-how-to-create-a-dialog-without-a-title and I haven't been able to do it still. I'll edit my OP to show my code.
TehGoose