我收到了错误
The method findViewById(int) is undefined for the type PM_section
在尝试实现我的可扩展ListView时.我确信这是一个常见的错误,但我找不到解决方案.我试图学习碎片等等,自从我开始以来,它一直是一场艰苦的战斗.我做了很多搜索,发现了很多结果,在我的情况下似乎没有帮助我.
如果有人能给我任何见解,或指出我正确的方向,我将非常感激.
我的小测试课程如下
public class PM_section extends Fragment {
// CustomExpListView custExpListView;
@Override
public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
View V = inflater.inflate(R.layout.fragment_pm_section_test,container,false);
CustomExpListView custExpListView = (CustomExpListView)
this.findViewById(R.id.ExpandableListView01);
return V;
}// end on create
}
CustomExpListView类几乎是从Android示例项目中复制粘贴的,并且很开心且没有问题.
谢谢你帮助我.