Fragment IllegalStatexception on getResources()
问题 I have this line inside SubCategoryFragment : s.group_name = SubCategoryFragment.this.getResources().getString(R.string.everything_else); // line 315 in stacktrace My understanding was that by adding SubCategoryFragment.this to this would prevent the IllegalStatexception. This is a ListFragment . This occurs when someone clicks on a list item in this fragment, and goes to another; then hits the back button and returns to SubCategoryFragment . onActivityCreated() where this line above