//事先定义变量,而且只使用这一个
Toast mytoast = new Toast(mContext);
LayoutInflater inflate = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflate.inflate(com.android.internal.R.layout.transient_notification, null);
//这里的setView不能少,当然set的view也可以是从自己写的布局xml中构造
mytoast.setView(v);
//设置显示的文字
mytoast.setText("显示内容");
//持续时间
mytoast.setDuration(Toast.LENGTH_SHORT);