You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.
When swapCursor() is called on a SimpleCursorAdapter and the cursor is transitioning from null to populated, the app encounters a NPE. This is due to requestFocus() being called from AdapterDataSetObserver.onChanged(), where other adapters (in particular AdapterView.AdapterDataSetObserver) call requestLayout() instead.
Ideally, the layout should not happen until onLayout().
This is using the Android v4 support library.
Demo:
(make sure to add <uses-permission android:name="android.permission.READ_CONTACTS"/> and at least one contact)
When
swapCursor()
is called on aSimpleCursorAdapter
and the cursor is transitioning fromnull
to populated, the app encounters a NPE. This is due torequestFocus()
being called fromAdapterDataSetObserver.onChanged()
, where other adapters (in particularAdapterView.AdapterDataSetObserver
) callrequestLayout()
instead.Ideally, the layout should not happen until onLayout().
This is using the Android v4 support library.
Demo:
(make sure to add
<uses-permission android:name="android.permission.READ_CONTACTS"/>
and at least one contact)The text was updated successfully, but these errors were encountered: