Пример #1
0
        }//class2

        void StartReceiver(Context context)
        {
            _ctx  = context;
            _rcvr = new DiscoRcvr1(this);
            var ifi = new Android.Content.IntentFilter();

            ifi.AddAction(Android.Bluetooth.BluetoothAdapter.ActionDiscoveryStarted);
            ifi.AddAction(Android.Bluetooth.BluetoothAdapter.ActionDiscoveryFinished);
            ifi.AddAction(Android.Bluetooth.BluetoothDevice.ActionFound);
            //ifi.AddAction (MyFakeActionFound);
            //ifi.AddAction ("android.intent.action.CAMERA_BUTTON");
            _ctx.RegisterReceiver(_rcvr, ifi);
        }
Пример #2
0
 public PackageIntentReceiver(AppListLoader loader)
 {
     mLoader = loader;
     Android_Content.IntentFilter filter = new Android_Content.IntentFilter(Android_Content.Intent.ACTION_PACKAGE_ADDED);
     filter.AddAction(Android_Content.Intent.ACTION_PACKAGE_REMOVED);
     filter.AddAction(Android_Content.Intent.ACTION_PACKAGE_CHANGED);
     filter.AddDataScheme("package");
     mLoader.Context.RegisterReceiver(this, filter);
     // Register for events related to sdcard installation.
     Android_Content.IntentFilter sdFilter = new Android_Content.IntentFilter();
     sdFilter.AddAction(IntentCompat.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE);
     sdFilter.AddAction(IntentCompat.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE);
     mLoader.Context.RegisterReceiver(this, sdFilter);
 }