Friday 23 September 2011

Customizing Toast

Many times we want to display our toast in custom manner, We can modify a Toast by setting its display position and assigning it alternative views or layouts.



Toast toast = Toast.makeText(getApplicationContext(), "Toast Example", duration);
int offsetX = 0;
int offsetY = 0;
toast.setGravity(Gravity.BOTTOM, offsetX, offsetY);
toast.show();

No comments:

Post a Comment