Toast是Android用来显示显示信息的一种机制,和Dialog不一样的是,Toast是没有焦点的,显示一段时间后自动消失.
makeText(Context context, int resId, int duration) ;//Make a standard toast that just contains a text view with the text from a resource.
makeText(Context context, CharSequence text, int duration) ;//Make a standard toast that just contains a text view.
setDuration(int duration) ;//Set how long to show the view for.
具体参考API;
如果需要一直显示可以用Dialog,或者使用线程实现。
一下想明白为什EditText的getText()返回的是Editable类型的东西。看了下Editable的API:
This is the interface for text whose content and markup can be changed (as opposed to immutable text like Strings). If you make a DynamicLayout of an Editable, the layout will be reflowed as the text is changed.
原来Editable就像Java的StringBuffer,可变字符串类。可通过以下方法得到一个实例:
Editable str=Editable.Factory.getInstance().newEditable("我是英雄");
最有用的还是str.append("")方法