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);
     }
 }
コード例 #2
0
 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);
     }
 }