Hello I am looking for sample code in which cursor adapter is used with sqlite?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
In Android, How to use a Cursor with a raw query in sqlite:
CursorAdapter Example with Sqlite
Really simple example.
Here is a really simple, but very effective, example. Once you have the basics down you can easily build off of it.
There are two main parts to using a Cursor Adapter with SQLite:
Create a proper Cursor from the Database.
Create a custom Cursor Adapter that takes the Cursor data from the database and pairs it with the View you intend to represent the data with.
1. Create a proper Cursor from the Database.
In your Activity:
2. Create a Custom Cursor Adapter.
Note: Extending from
ResourceCursorAdapter
assumes you use XML to create your views.