My problem is that I cannot reach ListView in Java. I’m using a ListActivity. In XML layout, I have a listview but I added it like android:id="@android:id/list
When I try to reach that list with code findViewById(R.id.list) … I does not work because it is not my namespace’s view.
I need to add clicklistener to my view which is added like “@android:id”.
My Java part :
mailList = (ListView)findViewById(R.id.list);
My XML Part:
<ListView android:layout_height="400dp"
android:id="@android:id/list"
android:layout_width="wrap_content"></ListView>
You can get the list id from the Android resources class like this: