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.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Anbu ManiRank #206 · 11.7K reputationPosted May 15, 2017, 11:01 AM EDT
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 MohapatraRank #182 · 13.2K reputationPosted May 15, 2017, 6:17 AM EDT