Bug 44842 - OnBackPressed in FormsAppCompatActivity InvalidOperationException - "Sequence contains no elements" on Linq Last()
Summary: OnBackPressed in FormsAppCompatActivity InvalidOperationException - "Sequence...
Status: RESOLVED NORESPONSE
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: E.Z. Hart [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2016-09-28 19:01 UTC by aslclay
Modified: 2017-06-19 18:47 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NORESPONSE

Description aslclay 2016-09-28 19:01:32 UTC
App crashes any time the back button is pressed. It doesn't matter if the current page is the root of the navigation stack or farther down the stack. The ActionBar "up" button does work as expected.

at System.Linq.Enumerable.Last[TSource] (IEnumerable`1 source) [0x0007e] in <filename unknown>:0 
  at Xamarin.Forms.Platform.Android.AppCompat.Platform.HandleBackPressed (System.Object sender, System.EventArgs e) [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\FormsApplicationActivity.cs:271 
  at (wrapper delegate-invoke) <Module>:invoke_bool_object_EventArgs (object,System.EventArgs)
  at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnBackPressed () [0x00012] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\FormsApplicationActivity.cs:163 
  at Android.App.Activity.n_OnBackPressed (IntPtr jnienv, IntPtr native__this) [0x00009] in <filename unknown>:0 
  at (wrapper dynamic-method) System.Object:b63a2dfc-df9b-49b7-a944-0786ffc2ea73 (intptr,intptr)
Comment 1 E.Z. Hart [MSFT] 2016-10-03 22:12:57 UTC
Thank you for taking the time to submit the bug. We tried to reproduce the issue you reported but were unable given the description. If you could please attach a reproduction to the bug by starting with a clean Xamarin.Forms project and adding just the code necessary to demonstrate the issue, we would very much appreciate it.

For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d

Warm regards,

Xamarin Forms Team
Comment 2 Samantha Houts [MSFT] 2017-06-19 18:47:28 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!