Edit: The question in one line:
How to pass along context from a MenuItem onOptionsItemSelected?
Edit 2: Here is a global indication of what I’m doing: https://github.com/JakeWharton/ActionBarSherlock/blob/master/samples/fragments/src/com/actionbarsherlock/sample/fragments/FragmentTabsPager.java
I’m building an app based on ActionBarSherlock. It uses tabs, fragments and a viewpager. It’s meant to be as versatile as possible. A tab can either contain a webview, or a listview. Here’s a screenshot:

When the tab (SherlockListFragment) is first loaded, it reads content from a feed using an ASyncTask. OnPostExecute it updates the list and saves the result to a SharedPreference string (as a way of caching). As you can imagine, the AsyncTask requires context to do this. I’m calling the asynctask from the SherlockListFragment like this:
x.new refreshList(this,getActivity()).execute();
(x being a reference to my current file).
And transfer it to my AsyncTask like this
public refreshList(TabList a,Context b){
this.mContext = a;
this.mCont = b;
}
All that works fine. But as you can see I’ve added in a menu item for refreshing. The way I’ve set things up, I’m not capable of re-running the ASyncTask, since I haven’t got the appropriate context information. Can anyone tell me how to perform a refresh in this situation?
If anyone willing to help requires to see more code, I’ll gladly comply.
Thanks in advance.
Although Jason answered my question correctly, I found out I had an additional problem after. I placed onOptionsItemSelected in my FragmentActivity. When I moved it over inside my ListFragment I got his answer working.