I want to show a custom dialog in a webview app when there is no connection to the Internet. How can I check the Internet connection and after that call a dialog?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use ConnectivityManager to check if there is an internet connection, and you can show a Toast AlertDialog message to the user.
See also: AlertDialog.Builder
Edit:
Here is an example of how to do this with a Toast message: