What is cursor Adapters in Android

Last updated:9/19/2020 11:21:03 AM

1 Answers

Anonymous User
Anonymous User

Android provides adapter classes specifically to display data from an SQLite database query. There is SimpleCursorAdapter class, which is more simpler and you cannot use your own custom xml layout and you don't have the control of the layout. In order to use custom xml layout, Android provides CursorAdapter.

A CursorAdapter makes it easy to use when the resource of a listview is coming from database and you can have more control over the binding of data values to layout controls. In the newView() method, you simply inflate the view and return it. In the bindView() method, you set the elements of your view.