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. How to increase the resolution

how to increase the resoltion in android...
   what all changes need to do in the source code to get 1280X720p
resolution...

-- 

2. CameraSurfaceView and how surfaceCreated() gets called

I have some questions regarding code below for camera preview
applicaiton.  Can someone please help me out?

1.  How does surfaceCreated get called?  From SDK, it is called
immediately after the surface is first created, but I still don't know
who creates this surface?

2.  Why do we need to set it as SURFACE_TYPE_PUSH_BUFFERS?

3.  How does this surface relate to the preview buffers?  Are the
preview buffers allocated by the Camera Service during startPreview?

private class CameraSurfaceView extends SurfaceView implements
SurfaceHolder.Callback {
        private SurfaceHolder mHolder;
        private Camera camera = null;

        public CameraSurfaceView(Context context) {
            super(context);
            mHolder = getHolder();
            mHolder.addCallback(this);
            mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
        }

        public void surfaceCreated(SurfaceHolder holder) {
            camera = Camera.open();
            try {
                camera.setPreviewDisplay(mHolder);
            } catch (Exception e) {
                Log.e("Camera", "Failed to set camera preview
display", e);
            }
        }
}

Thank you very much for your help.
an

-- 

3. Application not responding after resuming with an unlock

4. cannot set proxy when download sdk

5. WAP browser for Android

6. Enabled and Disable APN

7. Need help developing an app