Skip to content

Instantly share code, notes, and snippets.

@choiboi
Created August 2, 2013 21:25
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 choiboi/6143583 to your computer and use it in GitHub Desktop.
Save choiboi/6143583 to your computer and use it in GitHub Desktop.
// Get the layout you want and set the values inside that layout.
View toastRoot = getLayoutInflater().inflate(R.layout.activity_toast_custom_toast, null);
TextView tvToast = (TextView) toastRoot.findViewById(R.id.toast_textview);
tvToast.setText(TOAST_CUSTOM_BG_MSG);
// Create new Toast object and set the view to the one you want.
Toast toast = new Toast(getApplicationContext());
toast.setView(toastRoot);
toast.show();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment