예제 #1
0
        public override void OnCreate()
        {
            InitList();
            InitPlayer();

            prefs = new ServiceSharedPref(this);
            RepeatSharedPrefs repPref   = new RepeatSharedPrefs(this);
            RepeatMethod      repMethod = repPref.GetMethod();

            ChangeLoopback(repMethod.ToString());

            if (Build.VERSION.SdkInt >= BuildVersionCodes.O)
            {
                var notificationManager  = GetSystemService(Context.NotificationService) as NotificationManager;
                NotificationChannel chan = new NotificationChannel("com.PapIndustries.PapMediaPlayerService", "NotChannel", NotificationImportance.Max)
                {
                    LightColor           = Color.Blue,
                    LockscreenVisibility = NotificationVisibility.Public
                };
                notificationManager.CreateNotificationChannel(chan);
            }
            SetNotificationBar();
            RegisterReceivers();
            if (notify != null)
            {
                StartForeground(SERVICE_ID, notify);
            }
            base.OnCreate();
        }
예제 #2
0
        private void SaveRepMethod()
        {
            RepeatSharedPrefs rep = new RepeatSharedPrefs(this);

            //Save
            rep.SetMethod(manager.Enumerate());
        }