I have 2 activities. The second .xml looks like this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ListView
android:id="@+id/TrainsListView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
Part of the manifest:
<activity android:name="TrainsActivity">
</activity>
And I'm trying to get a TrainsListView:
mListView = (ListView) findViewById(R.id.TrainsListView);
But after that, mlistView is null. Why?
source
share