public static void RefreshGallery(string filePath) { if (AGDeviceInfo.SDK_INT >= AGDeviceInfo.VersionCodes.KITKAT) { ScanFile(filePath, null); } else { var uri = AndroidUri.FromFile(filePath); var intent = new AndroidIntent(AndroidIntent.ActionMediaMounted, uri); AGUtils.SendBroadcast(intent.AJO); } }
public static void RefreshGallery(string filePath) { if (AGDeviceInfo.SDK_INT >= AGDeviceInfo.VersionCodes.KITKAT) { using (var c = new AndroidJavaClass(MediaScannerConnectionClass)) { c.CallStatic("scanFile", AGUtils.Activity, new[] { filePath }, null, null); } } else { var uri = AndroidUri.FromFile(filePath); var intent = new AndroidIntent(AndroidIntent.ACTION_MEDIA_MOUNTED, uri); AGUtils.SendBroadcast(intent.AJO); } }