Exemple #1
0
        private void CleanupReceivers()
        {
            if (m_screenReceiver != null)
            {
                UnregisterReceiver(m_screenReceiver);

                Utils.SafeDispose(m_screenReceiver);
                m_screenReceiver = null;
            }
        }
Exemple #2
0
        private void CleanupReceivers()
        {
            if (screenReceiver != null)
            {
                UnregisterReceiver(screenReceiver);

                SupportTools.SafeDispose(screenReceiver);

                screenReceiver = null;
            }
        }
Exemple #3
0
        private void EnsureReceivers()
        {
            if (m_screenReceiver != null)
            {
                return;
            }

            IntentFilter intentFilter = new IntentFilter();

            intentFilter.AddAction(Intent.ActionScreenOn);
            intentFilter.AddAction(Intent.ActionScreenOff);
            m_screenReceiver = new ScreenReceiver(this);
            RegisterReceiver(m_screenReceiver, intentFilter);
        }