Hi All,
I need to build a AlertDialog with a short text ("A") and an OK
Button. But if I use AlertDialog.Builder, the "ok" text button is not
shown with a short text message. I tried to recover the Button object
and set the layout to wrap_content. But when I try to use getButton
function, it returns me null.
What Do I need to recover the button correctly and set the width as
wrap_content?
Thanks all.
The code :
AlertDialog.Builder builder = new AlertDialog.Builder(this)
.setPositiveButton("OK",
mOKListener)
.setMessage("A")
.setCancelable(false);
AlertDialog alertDialog = builder.create();
Button button = (Button) alertDialog.getButton(BUTTON_POSITIVE);
// edit the button size
alertDialog.show();
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---