wxr
2024-08-27 bfb3d0d4879dca8c59ff287c92f5113162f3a33a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using Android.Content;
using Java.IO;
 
namespace HDL_ON_Android
{
    /// <summary>
    /// 常用方法工具类
    /// </summary>
    public class HDLONUtils
    {
        public HDLONUtils()
        {
        }
 
        /// <summary>
        /// 发送广播,通知刷新图库的显示
        /// </summary>
        /// <param name="path"></param>
        public static void SendBroadcastScanFile(Context context, string path)
        {
            try
            {
                // 发送广播,通知刷新图库的显示
                Intent scanIntent = new Intent(Intent.ActionMediaScannerScanFile);
                scanIntent.SetData(Android.Net.Uri.FromFile(new File(path)));
                context.SendBroadcast(scanIntent);
            }
            catch
            {
                System.Console.WriteLine("发送广播刷新图库 catch");
            }
        }
 
        //public static void StartSplashActivity()
        //{
        //    Intent intent = new Intent(Shared.Application.Activity, typeof(SplashActivity));
        //    Shared.Application.Activity.StartActivity(intent);
        //    Shared.Application.Activity.Finish();
        //}
 
    }
}