Nouman Ghaffar
Nouman Ghaffar

Reputation: 137

Get data from multiple tables using Content Provider

Hello everyone, I am using content provider and create a database with multiple tables. I already get , insert , update and delete the values of tables. Now I want to get data from multiple tables in a single query. I wounder how can I do it by content provider and cursor. Kindly help me on this. Thanks

Upvotes: 2

Views: 1148

Answers (1)

sjain
sjain

Reputation: 23344

You can join multiple tables using a ContentProvider.

Look at android-contentprovider-database-query-multiple-tables.

So the source code is also available at GitHub,

https://github.com/android/platform_packages_providers_contactsprovider/blob/master/src/com/android/providers/contacts/ContactsProvider2.java

Upvotes: 1

Related Questions