I have a typical application. The activity that FrameLayout has in this layout, I want to switch between fragments. This is usually and easily done with:
getFragmentManager().beginTransaction()
.replace(R.id.ac_container, new FrOverview())
.addToBackStack(null)
.commit();
The problem is that even if I use .addToBackStack(null)(And I know that it was added because the number of stack is increasing), when I click the "I" button, I exit the application. I tried a lot of different code things and checked most of the threads here in Stackoverflow, but I can't get it to work with the code (method calls, etc.).
But! I can make it work by changing the extended class of my activity class. If my class extends Activity, it works great. But if I use AppCompatActivity(which, in turn, extends FragmentActivity), then it has bad behavior, as explained earlier.
It seems that this should be a mistake in the part of androids, I am not doing anything wrong with my knowledge.
Does anyone have any suggestions on how to solve this? that is, get back the functionality and save the ActionBar!
source
share