Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Adding Check for Network
class LoginActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
signInButton.setOnClickListener { view ->
if (isNetworkConnected()) {
} else {
AlertDialog.Builder(this).setTitle("No Internet Connection")
.setMessage("Please check your internet connection and try again")
.setPositiveButton(android.R.string.ok) { _, _ -> }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.