I have an imageview, and a button, starting an image intent.
I pass the uri from image intent to a function that should return the real path from the uri.
here's the activity result of image intent:
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
{
base.OnActivityResult(requestCode, resultCode, data);
FindViewById(Resource.Id.imguri1).Text = a.GetRealPathFromURI(data.Data);
}
and the function returning the real path:
public class GiocaUri : Activity
{
public string GetRealPathFromURI(Android.Net.Uri a)
{
ICursor cursor;
cursor = ContentResolver.Query(a, null, null, null, null);
cursor.MoveToFirst();
string documentId = cursor.GetString(0);
documentId = documentId.Split(':')[1];
cursor.Close();