0

I extend the ContentProvider to access SQLiteDatabase in my code, but I want to get real path from a content uri. So I use the method provided here

However since I extend the ContentProvider, when I call getContentResolver().query() I actually called the query() in the ContentProvider I extended. Where I use db.query() there to get data from SQLiteDatabase.

How can I implement the query function in ContentProvider to make it query Uri:MediaStore.Images.Media.DATA. I tried to use super.query() , but query() is an abstract class.

Community
  • 1
  • 1
Edward
  • 161
  • 1
  • 1
  • 12
  • `getContentResolver().query()` is `ContentResolver#query`, not `ContentProvider#query` – pskink Mar 05 '16 at 17:55
  • @pskink I think `ContentResolver#query` actually calls `ContentProvider#query` it calls `IContentProvider#query` where IContentProvider, is "The ipc interface to talk to a content provider"? – Edward Mar 05 '16 at 18:21
  • ok, of course it calls `ContentProvider#query` at the and but it is not the `ContentProvider` you are extending but system's `ContentProvider` associated with `MediaStore.Video.Media#getContentUri(String volumeName)` – pskink Mar 05 '16 at 18:31
  • @pskink you're right, thanks – Edward Mar 05 '16 at 18:47

0 Answers0