安卓函数积累


getChildCount();

实际上是ViewGroup.getChildCount(),返回的是显示层面上的”所包含的子View个数”.直接子元素的个数,不包含子元素内部包含的元素个数

ListView.getCount();

实际上是AdapterView.getCount(),返回的是其Adapter.getCount()返回的值.也就是”所包含的Item总个数”.

getChildAt(index);

获取某个指定position的view.

instanceof

java 中的instanceof 运算符是用来在运行时指出对象是否是特定类的一个实例。instanceof通过返回一个布尔值来指出,这个对象是否是这个特定类或者是它的子类的一个实例。

用法:

result = object instanceof class

参数:

Result:布尔类型。

Object:必选项。任意对象表达式。

Class:必选项。任意已定义的对象类。

字符串比较

boolean equals(Object str)

//忽略大小写

boolean equalsIgnoreCase(String str)

handler

sendEmptyMessage(int what)

sendMessage(Message msg)

removeMessages//移出队列中的消息

你可能感兴趣的:(安卓函数积累)