//第一个参数 上下文 context---The context to use. Usually your Application or Activity object.
//第二个参数 文本信息 text---The text to show. Can be formatted text.
//第三个参数 显示时间duration---How long to display the message. Either LENGTH_SHORT or LENGTH_LONG
二、在Toast中添加View
//创建Toast对象
Toast showViewToast = new Toast(this);//创建一个View
ImageView imageView = new ImageView(this);
//设置资源
imageView.setImageResource(R.drawable.click);
//设置Toast上的View
showViewToast.setView(imageView);
//设置Toast的显示时间
showViewToast.setDuration(Toast.LENGTH_SHORT);
//显示Toast
showViewToast.show();