继承BaseAdapter类
class MyAdapter extends BaseAdapter{
@Override
public int getCount() {
return 0;
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
return null;
}
}
这是父类中的方法
高洛峰2017-04-17 17:27:24
Because these methods are shown in BaseAdapter
从它的父类或者实现接口中继承来的,需要开启Show inherited
才能在Structure
.
ringa_lee2017-04-17 17:27:24
BaseAdapter
是个抽象类,实现了ListAdapter
接口,getCount
、getItem
这几个方法都在ListAdapter
接口里,但是BaseAdapter
没写具体实现,所以你要继承BaseAdapter
You must write the implementation of these methods.
巴扎黑2017-04-17 17:27:24
Methods in subclasses cannot be found in the parent class of course, they are not the same class. Methods in the parent class can be found in the child class.