JakeWharton/ActionBarSherlock — Issue #122: FragmentActivity.onContentChanged() gets fired at the wrong time
Author: wuman
Created: 2011-12-12 17:16:15+00:00
State: open

On pre-Honeycomb devices, if you try to set a layout in your FragmentActivity subclass and expect to find some view in that layout upon onContentChanged(), you won't find it.

This is because in FragmentActivity.setContentView(...), ensureSupportActionBarAttached() actually fires first and calls setContentView() on your behalf. That causes the parent Activity class to think that a layout has been set and calls onContentChanged() prematurely. The user's own layout doesn't get inflated and added until after onContentChanged().