private void _viewOutsideHoursButton_Click(object sender, EventArgs e) { //SetShowTotalHoursButtonView(); try { TimeSpan outsideHours = _dataService.GetOutsideHours(); if (outsideHours.TotalMilliseconds > 0) { using Intent intent = new Intent(this, typeof(outsideActivityAggregationActivity)); StartActivity(intent); } else { string toastMessage = NEWACTIVITYORPREVIOUSACTIVITY; Toast.MakeText(Application.Context, toastMessage, ToastLength.Short).Show(); } } catch (System.NullReferenceException) { string toastMessage = NEWACTIVITYORPREVIOUSACTIVITY; Toast.MakeText(Application.Context, toastMessage, ToastLength.Short).Show(); } }