Dialogue box like trip advisor and show custom background or splash screen in android

view full story

http://stackoverflow.com – I am beginner in android development. Below i give my main activity.java code. My requirement if internet connection or wifi not working on mobile devices then following thing perform If internet connection not working then show the my splash screen backrgound on start of application and give the dialogue box or alert like this screenshot of trip advisor Check this image and screenshot. If cancel button press then dialogue box disappear and only display splash screen and if press try again then try to perform connect to internet. In my code i take the code buy dialogue box, i not want buy (HowTos)