Confirmation routine

by john brown » Fri, 30 Jul 2010 10:52:01 GMT


Sponsored Links
 Hello,

What is the recommended best practice for a "confirm routine"? A toast
object is something like a visual basic MsgBox() routine but I have
not found any variations for a toast that returns a "yes" or "no".

An example might be:

*********************************************************************
"you have entered a bid amount of $0.01. Select YES to permanently
place the bid or NO to discard this entry"

        YES                   NO

**********************************************************************

I searched for "confirm" and found that the notepad example does have
a "confirm" button. I did the exercise and found that this particular
confirm button does not exactly match what I am wanting. I did learn a
way of using an intent to create a confirm routine but I thought there
might be another (shorter) method that I have missed.

Thanks for your help. John Brown

(I posted this on beginners about 6 hours ago but it never appeared in
the list. ?)

--



Confirmation routine

by Frank Weiss » Fri, 30 Jul 2010 11:06:02 GMT


 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.

--


Sponsored Links


Confirmation routine

by nexbug » Fri, 30 Jul 2010 15:07:46 GMT


 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




--



confirmation routine

by john brown » Sun, 01 Aug 2010 13:13:23 GMT


 Hello,

What is the recommended best practice for a "confirm routine"? A toast
object is something like a visual basic MsgBox() routine but I have
not found any variations for a toast that returns a "yes" or "no".

An example might be:

*********************************************************************
"you have entered a bid amount of $0.01. Select YES to permanently
place the bid or NO to discard this entry"

         YES                   NO

**********************************************************************

I searched for "confirm" and found that the notepad example does have
a "confirm" button. I did the exercise and found that this particular
confirm button does not exactly match what I am wanting. I did learn a
way of using an intent to create a confirm routine but I thought there
might be another (shorter) method that I have missed.

Thanks for your help. John Brown

--



Other Threads

1. Attenuated sounds

I have been researching sound on Android and it's been suggested that 
you use setVolumeControlStream so that the OS will control the volume 
for you using the convenience keys.  How does this work for sounds that 
I have attenuated?  My audio engine has a master volume and then effects 
are played using a relative volume.  It looks to me that when I play 
using SoundPool that I will be setting the master volume for the 
device.  Is this correct?


--
Leigh McRae
www.lonedwarfgames.com

--

2. Android porting on montavista running device

HI Guys,

I want to port android on Davinci DM355 using 2.6.29 kernel. But as a new
bee I am not able to figure out which android configuration should I patch
to my Davinci 2.6.29. Please guide me ... I would be glad if anyone can give
me location from where I can get Android kernel (2.6.29). I am not sure I
have taken right one and also the files that I need to change to port it on
Davinci DM355.

Thanks in advance.

Regards,
Krunal








> > website:

3. google's trouble with nexus one

4. Arbitrary MMS Attachments in EXTRA_STREAM

5. Developing a C++ static library for use with Java on the Android

6. String resources do not update when orientation changes

7. String resources do not update when orientation changes