Friday 15 July 2011

android - What is getContentResolver().call() and how to use it -


I have read the documentation on Android

I also find a suitable example for no use Is of

According to the documentation, a method is call , which is inadequate when the standard provider provider methods can be used as a way to gain access to custom provider methods: Call the last bundle call (URI Yuri, string method, string ARG, bundle extras) provider-defined method

Then in my code I executed I do:

  getContentResolver (). Call (Yuri, Law, RGR, Xtra);   

But it always gives returns zero bundle In fact, provider The method is never called

Further research indicates an (alleged) discrepancy in the contract where Reseller has Uri Logic No equivalent PROVIDER parameter:

  Call bundle call (string method, string ARG, bundle extras) provider-defining method   

m The Zhe not clearly understand what can someone tell me in the right direction?

The next research indicates an inconsistency of the contract where in the resolution There is not an uri argument with a equivalent PROVIDER parameter

in the same way he has written it. To identify URI just ContentProvider - ContentProvider , he knows who is and why it is sent to URI .

Provider method does not allow override annotation

Yes, it does, as you can see:

  @ Override public bundle call (string method, string arg, bundle extras) {if (SET_KEY_METHOD.equals (method) & amp; amp; arg! = Null} {key = arg; } Return (empty); }   

However, your build target (e.g., Eclipse, Project & gt; Property & gt; Android) must be set to API level 11 or higher.

The related call () looks like this:

  getContentResolver (). Call (Provider Specialist CONTENT_URI, Provider SET_KEY_METHOD, "sekrit", null);   

Yes I have a method in the provider that has been declared 'public', which has been passed in the content 'logic' method.

It is not how it works. Call () at ContentResolver call call () on your ContentProvider .

No comments:

Post a Comment