示例#1
0
 private void HandleReadeLater()
 {
     try
     {
         var newsLocalService = new NewsLocalService();
         newsLocalService.Save(_news);
         Toast.MakeText(this, "Saved", ToastLength.Short).Show();
     }
     catch (Exception ex)
     {
         Toast.MakeText(this, "error: " + ex.Message, ToastLength.Long).Show();
     }
 }
        private void SaveSelectedNews(List <News> selectedNews)
        {
            try
            {
                var newsLocalService = new NewsLocalService();
                foreach (var news in selectedNews)
                {
                    newsLocalService.Save(news);
                }

                Toast.MakeText(Activity, $"{selectedNews.Count} news saved", ToastLength.Short).Show();
                selectedNews.Clear();
                Activity.InvalidateOptionsMenu();
                UnselectElements();
            }
            catch (Exception ex)
            {
                Toast.MakeText(Activity, ex.Message, ToastLength.Short).Show();
            }
        }
 public SavedNewsListFragment()
 {
     _newsLocalService = new NewsLocalService();
 }