2

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

pes502
  • 1,597
  • 3
  • 17
  • 32

1 Answers1

1

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

Community
  • 1
  • 1
sjain
  • 23,126
  • 28
  • 107
  • 185