---
title: "what is cursor adapter?"  
description: "what is cursor adapter?"  
author: "Prateek sharma"  
published: 2018-04-06  
canonical: https://answers.mindstick.com/qa/40990/what-is-cursor-adapter  
category: "android"  
tags: ["android"]  
reading_time: 2 minutes  

---

# what is cursor adapter?

## Answers

### Answer by Arti Mishra

**Cursor Adapter In Android**CursorAdapter classes is used to **[display data](https://www.mindstick.com/forum/34030/how-to-display-data-in-the-table-using-angular-js) from a [SQLite database](https://www.mindstick.com/forum/159314/how-can-synchronize-data-between-an-sqlite-database-and-a-mysql-database)**. And simpleCursorAdapter classes is simpler adapter that can’t use your own custom xml layout file and you don’t have the control of the layout file. If you want to [add custom](https://www.mindstick.com/forum/34385/add-custom-css-in-razor-view) xml layout file, then **android provides CursorAdapter classes**. CursorAdapter is most useful for, when you are using listView. and the resource of a listview is coming from database and you have full control over the binding of data values to layout control files. CursorAdapter uses, **newView() method** to **inflate the view and return it** and uses **bindView() method** to set the [component](https://www.mindstick.com/articles/12262/learn-how-to-make-a-component-in-magento-2) or elements of [your view](https://answers.mindstick.com/qa/98518/what-s-your-view-on-russia-annexing-15-of-ukraine-s-territory). \
**Here, show the relation between [ContentProvider](https://answers.mindstick.com/qa/32782/can-intent-be-used-to-provide-data-to-a-contentprovider-why-or-why-not)(), SimpleCursorAdapter() and the view.****\**![what is cursor adapter?](https://answers.mindstick.com/questionanswer/cce006c6-cba4-4818-b290-3046a48365b9/images/2e69ccdf-5290-463a-8023-66ca5e628867.png)\
Image Source\
\
In CursorAdapter, firstly you can **create new class which extends CursorAdapter** and give it any name. This new adapter class must be **inherit the CursorAdapter class** is as follows- \
public class MyCursorAdapterExample extends CursorAdapter { // Calling Default constructor public MyCursorAdapterExample(Context context, Cursor cursor, int flags) { ... ............... ....................\
} public void bindView(View view, Context context, Cursor cursor) { ... ................... ...................... } public View newView(Context context, Cursor cursor, ViewGroup parent) { ... .................. .....................\
return null; } } \


---

Original Source: https://answers.mindstick.com/qa/40990/what-is-cursor-adapter

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
