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(); } }
// 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; }
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)); }