Custom Alert Dialog if internet connection is not available
I show custom Alert Dialog if inteernet connection is not available but I find proble so , help and Reply me on my email address soon. I wait answer.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Anbu ManiPosted May 15, 2017, 3:01 PM
Android.Net.NetworkInfo activeConnection = connectivityManager.ActiveNetworkInfo;
bool isOnline = (activeConnection != null) && activeConnection.IsConnected;
if (isOnline == false)
{
var errorMessage = "Network Connection Failed";
Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(this);
builder.SetTitle("Result");
builder.SetMessage(errorMessage);
builder.SetCancelable(false);
builder.SetNegativeButton("OK", (EventHandler
builder.Show();
}
Manas MohapatraPosted May 15, 2017, 10:17 AM