【发布时间】:2013-01-21 22:35:16
【问题描述】:
我得到了错误
类型 PM_section 的 findViewById(int) 方法未定义
在尝试实现我的可扩展列表视图时。我确信这是一个常见错误,但我无法找到解决方案。我正在尝试学习碎片等,从我开始就一直是一场艰苦的战斗。我进行了相当多的搜索,发现了很多结果,这似乎对我的情况没有帮助。
如果有人能给我任何见解,或指出正确的方向,我将不胜感激。
下面是我的小测试课
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 示例项目中复制而来的,并且很高兴并且没有问题。
谢谢你帮助我。
【问题讨论】:
标签: android fragment expandablelistview