4,152 questions
Apparently needs to use Application Context
var cursor = Android.App.Application.Context.ContentResolver.Query(uri, reqCols, null, null, null);
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I would like to read SMS messages from Android so I use the Android code from here https://stackoverflow.com/a/66792224 but I am facing a problem with this line of code
var cursor = ContentResolver.Query(uri, reqCols, null, null, null);
that saying An object reference is required for the non-static field, method, or property 'ContentResolver.Query(Uri, string[]?, string?, string[]?, string?)'
Repo of the project is here https://github.com/asafgo/ReadSMSMessages
Thanks,
AG
Apparently needs to use Application Context
var cursor = Android.App.Application.Context.ContentResolver.Query(uri, reqCols, null, null, null);