Periodically crashes the application on Android. With it every time in different places. I can not understand for what reason. The structure of the application is simple: there is one Activity and a bunch of fragments . The output of the fragment is as follows:

ItemsFragment itemsFragment = new ItemsFragment() { GroupID = groupID, CurrentGroup = currentGroup }; itemsFragment.RetainInstance = true; var fragmentManager = SupportFragmentManager.BeginTransaction(); fragmentManager.Replace(Resource.Id.flContent, (SupportFragment)itemsFragment); fragmentManager.AddToBackStack(null); fragmentManager.Commit(); 

I use C # Xamarin, but on the java principle is the same, only the syntax is slightly different. Help a novice android developer understand and understand what is the reason.

  • Error information available? Text, number or something? - Anatol
  • On mobile device crashes: “Unfortunately App has Stopped” - Igor
  • Wherever you can try and get the following error: Java.Lang.IllegalStateException:
  • Well, now with the text of the error, first google and study the top 3 results. - Anatol

1 answer 1

I do not know about C #, but in Jave there is such a method, try to replace the last line with:

 fragmentManager.commitAllowingStateLoss(); 
  • thanks, I'll try now ... - Igor