NullPointerException on setShareIntent using ActionBarSherlock
===

I'm trying to use ActionBarSherlock + ShareActionProvider in a SherlockActivity.
I've already checked this (http://stackoverflow.com/questions/10633140/nullpointerexception-using-shareactionprovider-actionbarsherlock) but it doesn't solve my problem.
I think the code is correct, but I keep getting FC and this logcat:

             07-25 15:31:26.758: E/AndroidRuntime(911): FATAL EXCEPTION: main
        07-25 15:31:26.758: E/AndroidRuntime(911): java.lang.NullPointerException
        07-25 15:31:26.758: E/AndroidRuntime(911): 	at com.corsalini.david.calcolopesi.ActCalcolo.onCreateOptionsMenu(ActCalcolo.java:162)
        07-25 15:31:26.758: E/AndroidRuntime(911): 	at com.actionbarsherlock.app.SherlockActivity.onCreatePanelMenu(SherlockActivity.java:173)
        07-25 15:31:26.758: E/AndroidRuntime(911): 	at com.actionbarsherlock.ActionBarSherlock.callbackCreateOptionsMenu(ActionBarSherlock.java:556)
        07-25 15:31:26.758: E/AndroidRuntime(911): 	at com.actionbarsherlock.internal.ActionBarSherlockCompat.preparePanel(ActionBarSherlockCompat.java:483)
        07-25 15:31:26.758: E/AndroidRuntime(911): 	at com.actionbarsherlock.internal.ActionBarSherlockCompat.dispatchInvalidateOptionsMenu(ActionBarSherlockCompat.java:273)
        07-25 15:31:26.758: E/AndroidRuntime(911): 	at com.actionbarsherlock.internal.ActionBarSherlockCompat$1.run(ActionBarSherlockCompat.java:988)
        07-25 15:31:26.758: E/AndroidRuntime(911): 	at android.os.Handler.handleCallback(Handler.java:587)
        07-25 15:31:26.758: E/AndroidRuntime(911): 	at android.os.Handler.dispatchMessage(Handler.java:92)
        07-25 15:31:26.758: E/AndroidRuntime(911): 	at android.os.Looper.loop(Looper.java:123)
        07-25 15:31:26.758: E/AndroidRuntime(911): 	at android.app.ActivityThread.main(ActivityThread.java:3683)
        07-25 15:31:26.758: E/AndroidRuntime(911): 	at java.lang.reflect.Method.invokeNative(Native Method)
        07-25 15:31:26.758: E/AndroidRuntime(911): 	at java.lang.reflect.Method.invoke(Method.java:507)
        07-25 15:31:26.758: E/AndroidRuntime(911): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
        07-25 15:31:26.758: E/AndroidRuntime(911): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
        07-25 15:31:26.758: E/AndroidRuntime(911): 	at dalvik.system.NativeStart.main(Native Method)


Here is the code: 

        public boolean onCreateOptionsMenu(Menu menu) {
		MenuInflater inflater = getSupportMenuInflater();
		inflater.inflate(R.menu.menu_main, menu);
		MenuItem menuItem = menu.findItem(R.id.miShare);
		ShareActionProvider mShareActionProvider = (ShareActionProvider) menuItem.getActionProvider();
		// Set the default share intent
		Intent shareIntent = new Intent(Intent.ACTION_SEND);
		shareIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
		shareIntent.setType("text/plain");
		shareIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.share_text));
		shareIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.share_subject));
		mShareActionProvider.setShareIntent(shareIntent);
		return true;
	}    

And here is the xml for the menu:
 
       <?xml version="1.0" encoding="utf-8"?>
    <menu xmlns:android="http://schemas.android.com/apk/res/android" >

    <item
        android:id="@+id/miPref"
        android:icon="@drawable/ic_action_settings"
        android:showAsAction="ifRoom"
        android:title="@string/settings"
        android:visible="true">
    </item>
    <item
        android:id="@+id/miReset"
        android:icon="@drawable/ic_action_reset"
        android:showAsAction="ifRoom"
        android:title="@string/reset"
        android:visible="true">
    </item>
    <item
        android:id="@+id/miShare"
        android:actionProviderClass="android.widget.ShareActionProvider"
        android:showAsAction="ifRoom"
        android:title="@string/share"/>

    </menu>


