コード例 #1
0
 private void Registrar()
 {
     if (_socket == null)
     {
         _ventana.RegisterReceiver(this, new IntentFilter(BluetoothDevice.ActionFound));
         _ventana.RegisterReceiver(this, new IntentFilter(BluetoothAdapter.ActionDiscoveryStarted));
         _ventana.RegisterReceiver(this, new IntentFilter(BluetoothAdapter.ActionDiscoveryFinished));
         bRegistrado = true;
         Adapter.StartDiscovery();
     }
     else
     {
         Toast.MakeText(Application.Context, "Lector sincronizado", ToastLength.Long).Show();
     }
 }
コード例 #2
0
        //  private string savedir;

        //  private string savefilename;
        public TmsDownloadManager(AppCompatActivity activity)
        {
            downloadManager = (DownloadManager)activity.GetSystemService(Context.DownloadService);
            this.activity   = activity;
            activity.RegisterReceiver(CreateDownloadReceiver(),
                                      new IntentFilter(DownloadManager.ActionDownloadComplete));


            //  savedir =Android.OS. Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryDownloads).AbsolutePath;
        }
コード例 #3
0
        private void SetBroadcastReceiverToInstallAppWhenDownloadIsComplete(Android.Net.Uri uri, DownloadManager manager, long downloadId)
        {
            DownloadReceiver onComplete = new DownloadReceiver(uri, manager, downloadId, activity);

            activity.RegisterReceiver(onComplete, new IntentFilter(DownloadManager.ActionDownloadComplete));
        }