Ejemplo n.º 1
0
        public static List <string> GetResult(ContentResolver resolver, Intent data)
        {
            List <Uri>    uris  = data.GetParcelableArrayListExtra(ImageSelectActivity.EXTRA_RESULT_SELECTION) as List <Uri>;
            List <string> paths = new List <string>();

            if (uris == null)
            {
                return(paths);
            }
            foreach (Uri uri in uris)
            {
                paths.Add(PhotoMetadataUtils.GetPath(resolver, uri));
            }
            return(paths);
        }
Ejemplo n.º 2
0
        public bool CheckType(ContentResolver resolver, Uri uri)
        {
            MimeTypeMap map = MimeTypeMap.Singleton;

            if (uri == null)
            {
                return(false);
            }
            string type = map.GetExtensionFromMimeType(resolver.GetType(uri));

            foreach (string extension in mExtensions)
            {
                if (extension.Equals(type))
                {
                    return(true);
                }
                string path = PhotoMetadataUtils.GetPath(resolver, uri);
                if (path != null && path.ToLower().EndsWith(extension))
                {
                    return(true);
                }
            }
            return(false);
        }