Created
December 15, 2014 12:07
-
-
Save RichLogan/40b859d506db0811d783 to your computer and use it in GitHub Desktop.
Toast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Context context = getApplicationContext(); | |
CharSequence text = "TEXT HERE"; | |
//Length | |
int duration = Toast.LENGTH_LONG; | |
Toast toast = Toast.makeText(context, text, duration); | |
//Position | |
toast.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, 100); | |
//Background Color | |
//toast.getView().setBackgroundColor(Color.RED); | |
toast.show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment