How to dismiss the single select dialog in AlertDialog

by mercury xu » Sun, 15 Mar 2009 13:13:01 GMT


Sponsored Links
 i Vincent

That a good idea , as we know, if we build an alterDlg need following
code

//modify by mercury xu 20090314 in the new sdk
//they don't support this function as showAlert!

new AlertDialog.Builder(loginScreen.this)
.setTitle("Login Data")
.setMessage("Login :" + usrTxt + "\n"+ "PassWords : " + pwdTxt)
.setIcon(R.drawable.icon)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
setResult(RESULT_OK);
finish();
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
}
})
.show();

maybe you can try to change the setPositiveButton and setNegativeButton
as Not visible or comment them, and add following code for keyup or keydown
founction.

OnClickListener as setResult(RESULT_OK);
finish();

you can get some useful infomation from
http://developer.android.com/reference/android/app/AlertDialog.html.

boolean
onKeyDown<http://developer.android.com/reference/android/app/AlertDialog.html#onKeyDown%28int,%20android.view.KeyEvent%29>(int
keyCode,
KeyEvent<http://developer.android.com/reference/android/view/KeyEvent.html>event)
A
key was pressed down.
boolean
onKeyUp<http://developer.android.com/reference/android/app/AlertDialog.html#onKeyUp%28int,%20android.view.KeyEvent%29>(int
keyCode,
KeyEvent<http://developer.android.com/reference/android/view/KeyEvent.html>event)
A
key was released.

those two founction I hope that is your need.

Wish good luck and best regards!

Mercury







2009/3/15 vincent Kor <kor.vinc...@gmail.com>


--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Why can't my update be installed by users?

I did an app called "Hello Yahoo" and today I made an update. But
users said it can't be installed because the package is not signed
correctly. And after that the old version can't even be uninstalled
because the device thinks it is uninstalled already...... I never
experience that, but it is reported by many users.

I do use a different keystore to sign it with the update. Is this the
case?  How can I fix this?
--~--~---------~--~----~------------~-------~--~----~

2. openGL colors

I'm writing some 3D rendering code, having started from the API demos
to get the SurfaceHolder and openGL initialization/refresh logic. The
actual rendering after that is not a problem.

However, it seems that openGL does not create a surface properly. You
can see the problem in the API demo. Both the GLSurfaceView and
Translucent GLSurfaceView demos use the same Cube class to draw the
mesh, and so have the same color. But the result on screen has
inverted color channels in the translucent case.

To make it obvious, change the colors in the Cube.java color array to
be 0x10000, 0, 0, 0x10000 on each line. In the non-translucent demo,
the cube will appear red. In the translucent demo, it will show blue.

If the format set on the SurfaceHolder does not match the one
requested from openGL, it's obvious the phone does not do any
conversion, and simply copies the bits to the surface. That's
expected, except there seems to be no way to define them to be the
same if we want better then 565 quality.

The non-translucent demo uses a RGB 565 format, whereas the
translucent one uses RGBA 8888. But it seems open GL creates a BGRA
8888 instead.

Am I missing a call somewhere to specify the channel order?

--~--~---------~--~----~------------~-------~--~----~

3. Dev Phone -- unable to see paid app on market

4. Is it a timer_settime runtine's problem ?

5. Why my gallery on real device behave so oddly?

6. How do you get the local time zone?

7. TERRIBLE BUG IN MARKET APPLICATION (was Paid apps related questions discussion list?)