Created
June 6, 2016 17:22
-
-
Save liangfeidotme/78006d1e2e92aea18355610e33773c79 to your computer and use it in GitHub Desktop.
Customize an Android 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
final Toast toast = new Toast(context); | |
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0); | |
toast.setDuration(Toast.LENGTH_LONG); | |
LayoutInflater inflater = LayoutInflater.from(context); | |
toast.setView(inflater.inflate(R.layout.leak_canary_heap_dump_toast, null)); | |
toast.show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment