【发布时间】:2014-03-19 01:15:35
【问题描述】:
我的 result_page.xml 在布局下有一个 ListView。
<ListView
android:id="@+id/resultList"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
下面是我的活动截图
public class ResultActivity extends SherlockListActivity {
ListView listView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.result_page);
listView = (ListView) findViewById(R.id.resultList);
ResultPageAdapter adapter = new ResultPageAdapter(this, resultBeanList);
listView.setAdapter(adapter);
当我尝试调试时,listView 仍然是null。我错过了什么吗?
【问题讨论】:
-
请将代码贴在ResultPageAdapter中
-
@VikramV 我的意思是说,即使在这一点上它也是空的 => listView = (ListView) findViewById(R.id.resultList);
标签: android list android-listview android-activity actionbarsherlock