I checked the docs.
Now I have code like this:
Menu resource xml:
Activity:
This solved the problem.
Maybe Tim Moores can suggest some up to date book for us CS students newbies in Android
P.S. For anyone who is reading Head First Android Development:
After fixing ShareActionProvider, if you are following the book, you're most probabbly going to get NullPointerException in OrderActivity. If you have this code, like in the book:
This is going to get you NullPointer.
I just did this, reading from docs and SO, and its doing what the author wanted us to achieve: