How to speed up the populating of listview + filter Android
Mobile
1
Posts
1
Posters
0
Views
1
Watching
-
Hi, Android (C#) : I am populating my listview from Sqlite (sometime also from DataTable) 1. when the data is huge its very slow ? 2. how to have filter for this with high speed ?(same as contact list ) Thanks in advanced ! For filtering i have seen this code :
_adapter.Filter.InvokeFilter(_inputSearch.Text);
but just work for one column :
_adapter = new ArrayAdapter<string>(this, Resource.Layout.list_item, Resource.Id.product_name, products);
No USE At ALL !!!! my code :
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);// Create your application here SetContentView(Resource.Layout.HesabList); progress = ProgressDialog.Show(this, "", "Loading ..."); progress.SetProgressStyle(ProgressDialogStyle.Spinner); progress.Indeterminate = true; new Thread(new ThreadStart(delegate { \_btnUpdate = FindViewById<Button>(Resource.Id.UpdateHesabList); \_btnUpdate.Click += new EventHandler(\_btnUpdate\_Click); gvHesab = FindViewById<ListView>(Resource.Id.gvHesabList); gvHesab.ItemClick += new EventHandler<AdapterView.ItemClickEventArgs>(gvHesab\_ItemClick); isTarafHesab = Intent.GetBooleanExtra("IsTarafHesab", false); txtSearchHesabList = (EditText)FindViewById(Resource.Id.txtSearchHesabList); txtSearchHesabList.TextChanged += new EventHandler<Android.Text.TextChangedEventArgs>(txtSearchHesabList\_TextChanged); txtSearchHesabList.Gravity = GravityFlags.Right; Looper.Prepare(); File dbtest = new File(clsBase.SqliteDBPath); if (!dbtest.Exists() ) { if (clsBase.HasInternetConnection(this)) createDbSqlite(); else { MessageBoxAndroid.Show(this, "Connect to Internet First !"); Finish(); } } else { fillListView(); } RunOnUiThread(() => progress.Dismiss()); })).Start(); }
private void fillGridView()
{
try
{
SQLiteDatabase db = OpenOrCrea