Skip to content

Instantly share code, notes, and snippets.

@burntcookie90
Created November 4, 2015 02:15
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 burntcookie90/628166d86b2dc65e3506 to your computer and use it in GitHub Desktop.
Save burntcookie90/628166d86b2dc65e3506 to your computer and use it in GitHub Desktop.
@file:JvmName("ActivityUtils")
package io.dwak.sleepcyclealarm.extension
import android.app.Activity
import android.support.annotation.StringRes
import android.widget.Toast
@JvmOverloads
fun Activity.toast(message : String, length : Int = Toast.LENGTH_SHORT) {
Toast.makeText(this, message, length).show();
}
@JvmOverloads
fun Activity.toast(@StringRes message : Int, length : Int = Toast.LENGTH_SHORT) {
Toast.makeText(this, message, length).show();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment