I have a custom method save()
in my custom ContentProvider class MyContentProvider
which I want to call through the ContentResolver. The objective is to pass an POJO as a Bundle through to MyContentProvider
.
I am using the call
method as mentioned here and defined here.
I do not get any errors. The method is just not accessed.
The (shortened), custom ContentProvider with the custom method looks like this:
public class MyContentProvider extends ContentProvider {
public void save() {
Log.d("Test method", "called");
}
}
I call it like this:
ContentResolver contentResolver = context.getContentResolver();
Bundle bundle = new Bundle();
bundle.putSerializable("pojo", getPojo());
contentResolver.call(Contracts.CONTENT_URI, "save", null, bundle);
Why is the save
method never called and if I get to this point how do I access the called Uri and the Bundle in the save()
method? I could not find any reference for this anywhere on SO or the web.
Thank you for your answers!