Can't keep AlertDialog on screen when KeyEvent.KEYCODE_BACK is handled with 1.5 (??)

by Marco Nelissen » Fri, 29 May 2009 12:45:34 GMT


Sponsored Links
 It's not a bug. I'm guessing you were expecting AlertDialog.show() to block
until the user makes the choice, but that's not how it works.
It's easy to make this work though: simply don't call super.onKeyDown() when
the user pressed the back button. That will keep the system from ending your
activity. Then just call finish() when you do want to end the activity.







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



Can't keep AlertDialog on screen when KeyEvent.KEYCODE_BACK is handled with 1.5 (??)

by Rob Franz » Fri, 29 May 2009 12:50:35 GMT


 Thanks Marco.  Took out the super.onKeyDown and it does block... you're
right.
However, my complaint on the other thing - lack of setPositiveButton and
setNegativeButton - still stands :-)

If I do two calls to setButton, I only get the last button.  Were the above
two functions removed?

Thanks again.
Rob






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


Sponsored Links


Can't keep AlertDialog on screen when KeyEvent.KEYCODE_BACK is handled with 1.5 (??)

by Rob Franz » Fri, 29 May 2009 20:23:38 GMT


 YI, looks like setPositiveButton and setNegativeButton are gone, and now
you have setButton, setButton2, and setButton3.
On Fri, May 29, 2009 at 12:50 AM, Rob Franz <rob.fr...@gmail.com> wrote:


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



Other Threads

1. Problem in SimpleDateFormat MMM return month number



The problem is when you do not care what locale are set and simply
want to use system-wide, not any particular one.
Calling setDefault is same like passing locale to SimpleDateFormater
constructor - you need to either specify locale or read system
settings and pass that in hope it works. Since this is like blind fix
it may or may not work but you still do not know what the culprit is.

-- 

2. Android Market strips "Move to SD card" attribute -- what am I doing wrong?

Hi guys -- I have an app which I'd like people to be able to install
onto the SD card through Settings->Applications->Manage applications.

I now have a .apk file that if I install it directly, does allow me to
do the above, but when I submit it to Android Market and then install
from there, it doesn't (the option's greyed out for me, and it is for
others too).

Any idea what I need to do differently? I guess Market is rebuilding
the apk and losing the XML attribute along the way, but I can't see
why.

Here's my manifest file, which looks fine to me -- so I'm at a loss.
My eclipse project target SDK version is set to 8 (so that it
understands the new attribute), and android:minSdkVersion is set to 3
(as it always has been) -- which is my understanding of how the
android docs say I should do this :-(

Thanks in advance,

Mark


-------------

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      android:versionCode="37"
      android:versionName="2.14" package="com.wheadon.photoenhancepro"
      android:installLocation="auto">
    <uses-sdk android:minSdkVersion="3" />
    <uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <application android:icon="@drawable/icon" android:label="@string/
app_name"
    android:debuggable="false" >
        <activity android:name=".PhotoEnhance"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SEND"/>
                <category
android:name="android.intent.category.DEFAULT"/>
                <category
android:name="android.intent.category.ALTERNATIVE"/>
                <data android:mimeType="image/jpeg" />
            </intent-filter>
        </activity>
    <activity android:name=".Preferences" android:label="@string/
setPreferences"></activity>
    <activity android:name=".Crop" android:label="@string/crop"></
activity>
    </application>
</manifest>

-- 

3. A general purpose development phone

4. Database handling - when do you open and close

5. Hey my friend,

6. Salam perkenalan dari yang baru join.

7. AutoMMS code