Example #1
0
        public async void DeletePOIAsync()
        {
            POIService service = new POIService();

            if (!service.isConnected(activity))
            {
                Toast toast = Toast.MakeText(activity, "Not conntected to the internet. Please, check your device network settings.", ToastLength.Short);
                toast.Show();
                return;
            }

            string response = await service.DeletePOIAsync(_poi.Id);

            if (!string.IsNullOrEmpty(response))
            {
                Toast toast = Toast.MakeText(activity, String.Format("{0} deleted.", _poi.Name), ToastLength.Short);
                toast.Show();

                DBManager.Instance.DeletePOI(_poi.Id);

                if (!POIListActivity.isDualMode)
                {
                    activity.Finish();
                }
            }
            else
            {
                Toast toast = Toast.MakeText(activity, "Something went wrong!", ToastLength.Short);
                toast.Show();
            }
        }