private async void RefreshData() { await Task.Delay(TimeSpan.FromSeconds(0.3)); riwayatReminder = ReminderHelper.GetReminderList(); NotifyDataSetChanged(); }
protected override void OnResume() { base.OnResume(); // fetch latest data List <RiwayatReminder> data = ReminderHelper.GetReminderList(); // update data RecyclerView rvRiwayatReminder = FindViewById <RecyclerView>(Resource.Id.rvRiwayatReminder); ReminderAdapter mAdapter = new ReminderAdapter(data); LinearLayoutManager mLayoutManager = new LinearLayoutManager(this); rvRiwayatReminder.SetLayoutManager(mLayoutManager); rvRiwayatReminder.SetAdapter(mAdapter); }
private void BindData() { listitem = ReminderHelper.GetReminderList(this).ToArray(); if (listitem.Length > 0) { adapter = new GridReminder(this, listitem); list.Adapter = adapter; list.ItemClick += List_ItemClick; } else { list.Visibility = Android.Views.ViewStates.Invisible; _txtLabel.Visibility = Android.Views.ViewStates.Visible; _txtLabel.Text = "No upcoming reminders!!"; } }