完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/Toast.html

Toast

public class Toast
extends Object

java.lang.Object
   ↳ android.widget.Toast


A toast is a view containing a quick little message for the user. The toast class helps you create and show those.
Toast是一个视图,其中包含了显示给用户一条简短的消息。Toast类帮助你创建和显示这样的消息。

When the view is shown to the user, appears as a floating view over the application. It will never receive focus. The user will probably be in the middle of typing something else. The idea is to be as unobtrusive as possible, while still showing the user the information you want them to see. Two examples are the volume control, and the brief message saying that your settings have been saved.
当视图显示给用户时,通常显示为一个覆盖着应用程序上的浮动视图。它永远不会接收焦点。用户不会在其中输入什么。这样做的目的是尽可能地不引人注目,同时向用户显示你希望他们看到的信息。两个例子,一个是音量控制,另外一个是显示一条简短的消息,以提示你的设置已经保存。

The easiest way to use this class is to call one of the static methods that constructs everything you need and returns a new Toast object.

Developer Guides


使用这个类的最简单的方法是调用一个静态方法来构造你需要的所有东西,并返回一个新的Toast对象。

开发者指南

For information about creating Toast notifications, read the Toast Notifications developer guide.
关于创建Toast的更多信息,请参考Toast Notifications开发者指南。

摘要


常量

int LENGTH_LONG

Show the view or text notification for a long period of time.
显示长时间的视图或文本通知。

int LENGTH_SHORT

Show the view or text notification for a short period of time.
显示短时间的视图或文本通知。

Public构造方法

Toast(Context context)

Construct an empty Toast object.
创建一个空的Toast对象。

更多相关文章

  1. Android工作笔记:Android路径大全
  2. android:screenOrientation的说明
  3. android:screenOrientation的说明
  4. android GestureDetector应用
  5. 使用 ViewStub 延迟展开视图
  6. 详解android:scaleType属性
  7. Android那些事儿(一)成长中的Android
  8. android:screenOrientation属性(转)
  9. Android中layout属性大全

随机推荐

  1. Android(安卓)studio3.0 com.android.too
  2. Android(安卓)实现 zlib压缩与解压
  3. Android(安卓)SDCard操作
  4. android 红外
  5. Android之访问下载文件
  6. Android解析包名信息
  7. android 通过HttpPost 调用.Net Wcf
  8. android利用ViewPager做的介绍软件功能de
  9. ANDROID中SHAPE的使用
  10. android 捕获返回(后退)按钮事件的两种方法