private void SearchPerform() { if (_SearchString.Length == 0) { _ListView.Adapter = new SearchDownAdapter(this, new List <Download>()); _Loader.Visibility = ViewStates.Gone; return; } _Loader.Visibility = ViewStates.Visible; Thread th = new Thread(() => { _Downloads = DownloadManager.SearchDocuments(_SearchString); RunOnUiThread(() => { var adapter = new SearchDownAdapter(this, _Downloads); adapter.OpenAction += (string p) => { Intent i = new Intent(); i.SetClass(this, typeof(ViewerScreen)); i.SetAction(Intent.ActionView); i.PutExtra("pubPath", p); this.StartActivityForResult(i, 0); }; _ListView.Adapter = adapter; _Loader.Visibility = ViewStates.Gone; }); }); th.Start(); }
private void ItemClick(object sender, AdapterView.ItemClickEventArgs e) { var item = _Downloads[e.Position]; MBDownloadManager.RequestDownload(item.Uri, new VoidNotify()); item.Stato = DownloadStato.Downloading; //_ListView.Adapter = new SearchDownAdapter(this, _Downloads); var adapter = new SearchDownAdapter(this, _Downloads); adapter.OpenAction += (string p) => { Intent i = new Intent(); i.SetClass(this, typeof(ViewerScreen)); i.SetAction(Intent.ActionView); i.PutExtra("pubPath", p); this.StartActivityForResult(i, 0); }; _ListView.Adapter = adapter; }