Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //please help me to improve my channel
- //subscribe for more videos π
- LayoutInflater inflater = getLayoutInflater();
- View layout = inflater.inflate(R.layout.custom,
- (ViewGroup) findViewById(R.id.custom));
- TextView txt = (TextView) layout.findViewById(R.id.text);
- txt.setText("Hello! This is a custom toast!");
- Toast toast = new Toast(getApplicationContext());
- toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
- toast.setDuration(Toast.LENGTH_LONG);
- toast.setView(layout);
- toast.show();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement