how to display alert message when some one clicks on back button

by manoj » Tue, 27 Jan 2009 21:12:01 GMT


Sponsored Links
 Hi friends,

I want to display an alert asking "do you want to exit from the
application yes/no?" before exiting the application (when we click the
Back button).

Can any one please help me how to achieve this?

Thanks,
Manoj.
--~--~---------~--~----~------------~-------~--~----~



how to display alert message when some one clicks on back button

by Mark Murphy » Tue, 27 Jan 2009 21:12:33 GMT


 


Probably you will want to use AlertDialog, perhaps created using the
AlertDialog.Builder class.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
_The Busy Coder's Guide to Android Development_ Version 2.0 Published!

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


Sponsored Links


how to display alert message when some one clicks on back button

by manoj » Tue, 27 Jan 2009 21:17:54 GMT


 can you please show me the sample code?





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



how to display alert message when some one clicks on back button

by Tommaso » Wed, 11 Mar 2009 16:27:47 GMT


 Mark,

that works for Alerts if you have only ONE activity in your app.
For example purpose it is great. For real life it is misguiding.

I couldn't find a solution yet.
How do you show AlertDialog from a subactivity!?

Ciao,
  Tommaso





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



Other Threads

1. running emulator in non gui mode

Is it possible to run the emulator without gui showing?
I want to continually run test of my app on server that does not allow
opening GUI
Thanks

-- 

2. arowboat / TI Android FroYo DevKit V2 Released

Hi all,

We have released TI Android FroYo DevKit V2, please see more details
on http://arowboat.org

TI Android FroYo DevKit V2 features

- Supports AM35x, AM37x, OMAP35x processor, EVMs and Beagleboard (rev
C4 and XM)
- Android 2.2 FroYo
- OpenGL ES SGX drivers for 2D/3D acceleration
- Adobe Flash 10 for Android
- Linux Kernel version 2.6.32
- Android CTS compliant software
- RowboPERF performance measurement application
- Android default applications, audio, video playback, etc
- Documentation for User Guide, Test Result and CTS

See our "Four Easy Steps to Experience TI Android DevKit V2" flash video.

Please feel free to post your questions on rowb...@googlegroups.com.

Regards,
Khasim

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. Questions on how to invoke application form the browser

4. How to set unique id to the view programatically

5. MonitorThread NullPointerException

6. Problem With Thread !

7. android:layout_alignParentBottom="true" on code