Sunday 30 December 2012

How to Custamize Toast in Android?

You can customize your tost:
LayoutInflater mInflater=LayoutInflater.from(this);

View view=mInflater.inflate(R.layout.your_layout_file,null);
Toast toast=new Toast(this);
toast.setView(view);
toast.setDuration(Toast.LENGTH_LONG);
toast.show();
Or General way:
Toast.makeText(context,"Your message.", Toast.LENGTH_LONG).show();

No comments:

Post a Comment