Skip to content

Instantly share code, notes, and snippets.

@Dmuasya

Dmuasya/toast Secret

Created September 14, 2020 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dmuasya/454d7c458a194194d3d83e6ea2229b38 to your computer and use it in GitHub Desktop.
Save Dmuasya/454d7c458a194194d3d83e6ea2229b38 to your computer and use it in GitHub Desktop.
if ( connectivity != null)
{
info = connectivity!!.activeNetworkInfo
if (info != null)
{
if (info!!.state == NetworkInfo.State.CONNECTED)
{
Snackbar.make(view, "Internet Connected", Snackbar.LENGTH_LONG)
.setAction("Action", null).show()
}
}
else
{
Snackbar.make(view, "Internet Disconnected", Snackbar.LENGTH_LONG)
.setAction("Action", null).show()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment