另一个XML文件里 就一个Listview 这样报错 !
topBar = (LinearLayout) getLayoutInflater().inflate(R.layout.top_bar,
null).findViewById(R.id.top_bar);
能把错误贴出来吗,这样是几个意思
ListView list = (ListView) this.findViewById(R.id.listView);
topBar = (LinearLayout) list.findViewById(R.id.top_bar);
(LinearLayout) getLayoutInflater().inflate(R.layout.top_bar,null)不该写包含那个top_bar的文件名,该写这个activity的V模块名
你说的什么鬼啊………………报错在哪?
你说的什么鬼啊………………报错在哪?
Java语法问题
topBar = (LinearLayout) getLayoutInflater().inflate(R.layout.top_bar,null).findViewById(R.id.top_bar);
//拆分之后就好理解了
LinearLayout topbar = (LinearLayout) getLayoutInflater();//因为小括号有最高优先级,所以直接这样写会直接把LayoutInflater转换成LinearLayout