Whenever a application needs internet and connection fails, I get a message dialog
Connection failed
This application requires network access. Enable mobile network or Wi-Fi to download data.
and two buttons, Settings, Cancel.
How do I detect there is no internet connection?
How do I popup a same dialog in my application?
Here you can find a reference on how to build dialogs
http://developer.android.com/guide/topics/ui/dialogs.html
Here is a code snippet that should help you detecting internet access:
http://www.androidsnippets.org/snippets/131/
btw: wasn’t it you that asked this question already on 15. Nov. 2009?
http://groups.google.com/group/android-beginners/browse_thread/thread/715cedfc5fd6f020?utoken=QyP-dzQAAACEe9Lph6eUOAakqA3-BnR-KvPfK0ltyCETgVsCM3D7GeEWTAM9S5G8WBs1q2tBppm1FwwMIvCGKnxkm-CrwSdp