JakeWharton/ActionBarSherlock — Issue #285: Attempt SherlockFragmentActivity/SherlockFragment
Author: JakeWharton
Created: 2012-02-18 07:23:59+00:00
State: open

The only thing we modify `FragmentActivity`, `FragmentManagerImpl`, and `Fragment` for is to change the menu dispatching imports so that we can use our compatibility menu classes. Everything else we dispatch via overrides.

Theoretically, by overriding `FragmentActivity` we should be able to leverage the panel's menu to wrap our custom menu classes using an extension of the native type to dispatch through the normal methods. We would then need a `SherlockFragment` which provided final overrides of the native types to unwrap our custom menu and then execute our callbacks.

Something like this:

```java
SherlockFragment extends Fragment {
final boolean onOptionsItemSelected(android.view.MenuItem item) {
return onOptionsItemSelected(((MenuItemWrapper)item).unwrap());
}
boolean onOptionsItemSelected(MenuItem item) {
//override me
}
//etc...
}
```