继承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;
}
}
这是父类中的方法

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
因为这些方法是
BaseAdapter从它的父类或者实现接口中继承来的,需要开启Show inherited才能在Structure中显示出来。导包导错了。
BaseAdapter是个抽象类,实现了ListAdapter接口,getCount、getItem这几个方法都在ListAdapter接口里,但是BaseAdapter没写具体实现,所以你要继承BaseAdapter必须写这几个方法的实现。子类中的方法 父类中当然找不着了,都不是一个类 。父类中的方法在子类中能找到。