Hello I am getting following exception on line Stream grapes = ContentResolver.OpenInputStream(selectedImage);
, the image is not null I am using it on my view so perhaps I referencing it wrong?
JavaLang Null pointer exception, attempt to invoke virtual method android.contentResolver on null object reference
public String ScanService()
{
var selectedImage = Android.Net.Uri.Parse("@Resources/drawable/portrait.png");
Stream grapes = ContentResolver.OpenInputStream(selectedImage);
var options = new BitmapFactory.Options();
options.InJustDecodeBounds = true;
BitmapFactory.DecodeStream(grapes, null, options);
string test = "test";
Parsing(test);
return test;
}
I have tried this Android.Net.Uri.Parse("android.resource://demoregapp.android/drawable/portrait.png");
based on this
https://stackoverflow.com/questions/6602417/get-the-uri-of-an-image-stored-in-drawable
but still I am getting the same exception