johannilsson/android-pulltorefresh — Issue #44: PullToRefreshListView Coming Up As Null On 3.1 Honeycomb Devices
Author: kittcoldfire
Created: 2011-12-29 20:33:45+00:00
State: open

Hey there,

I'm using sections_list = (PullToRefreshListView)findViewById(android.R.id.list);

which is working perfectly on all devices I've tested it on with 2.1, 2.2, 2.3.x but I've just noticed that on devices running 3.x when trying to find the same id its returning null which is then crashing the app as there is no list to set the adapter too.

Is there another way to find this element? I've tried renaming it differently and it still returns null.

The XML looks like this for the element (and as I said it works fine on the other versions of android)

com.evolusent.lifestyler2.pulltorefresh.PullToRefreshListView
android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="0px"
android:layout_below="@id/contents_header"
android:scrollbars="none"
/>