Friday, July 30, 2010

[android-developers] Re: Confirmation routine

a simple approach is to use the AlertDialog as

AlertDialog.Builder bldr = new AlertDialog.Builder(this);
bldr.setTitle("confirm") ;
bldr.setMessage("place bid ?") ;
bldr.setPositiveButton(R.string.yes, new
DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog, int which) {
///code for YES
}
});

bldr.setNegativeButton(R.string.no, new
DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog, int which) {
// code for NO
}
});

bldr.show();

what was the reason you didnt like that approach ?
-g

On Jul 29, 8:05 pm, Frank Weiss <fewe...@gmail.com> wrote:
> I assume you want a blocking alert dialog like the MsgBox() function.
> This has been brought up before and basically "no can do" the way the
> Android UI thread works, AFAIK. The two "natural" android approaches:
>
> 1) An other activity that you start with startActivityForResult(),
> which can be themed as an alert dialog
> 2) An in-activity alert dialog whose callback changes the activity's
> state or completes the action you were hoping that the alert dilaog
> would block for.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate