尝试设置列表视图和我的数据库查询的结果。XML列表视图问题
无论如何,我从我的列表视图中得到一个奇怪的XML refrence id错误。任何人都可以在这里看到问题?我猜它的'@id'引用导致问题?
我的继承人XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/contentList"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</ListView>
</LinearLayout>
我的java类:
的错误是在 'R.id.conactList'。
ListView listContent = (ListView)findViewById(R.id.contentList);
你丢失大量的相关信息(堆栈跟踪,当你调用findViewById,该类从发出的呼吁,为什么你使用'id.contactList',而不是'id.contentList'等)但我会猜测你没有设置你的活动的内容视图。 – AedonEtLIRA