0

I want to know if could be possible that your custom content provider could be called by default by the operating system.

For example, if you open the contact app, is possible that in this moment your custom provider could be called and check at this moment?

If this is possible, how can I do this?

Thanks,

S.P.
  • 2,274
  • 4
  • 26
  • 57
  • Yes it is possible. Ex: Chrome/Firefox. Messages/Hangout. Gmail/email(when sending a mail) – Zoe Aug 25 '16 at 13:42
  • And how can I do it? Because I've searched and I can't find any good example. Maybe you have to indicate something in the provider label in the manifest? – S.P. Aug 25 '16 at 13:46
  • Possible duplicate of [How to set default app launcher programmatically?](http://stackoverflow.com/questions/27991656/how-to-set-default-app-launcher-programmatically) – Zoe Aug 25 '16 at 13:48
  • The example is launcher but the consept is the same – Zoe Aug 25 '16 at 13:48
  • Definitely Is not the same. I want to know if is possible that the operating system can call and check my provider when he call another provider at the same time. – S.P. Aug 25 '16 at 13:52
  • Are you read my question? "I want to know if could be possible that your custom content provider could be called by default by the operating system" – S.P. Aug 25 '16 at 13:54
  • The real answer is no. You can not. – DeeV Aug 25 '16 at 14:11

1 Answers1

1

Content provider authority names must be unique on the device. Your app cannot even be installed if it has an authority name that matches an existing one, whether the existing one is from another ordinary SDK app or from some pre-installed app. Hence, you cannot replace an existing content provider by "name".

Android does not offer any facility whereby the user could say "for ContentProvider operations for such-and-so content, please use this app rather than this pre-installed app", so the user cannot request to redirect all requests to your provider either.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491